On 04/07/17 11:51, Robert Moskowitz wrote:
I solved my mysql access problem with dovecot; turned out it was trying
a tcp connection and mysql is not listening on tcp. Fixed that to use
mysql.sock.
So this got me digging into how postfix was successfully accessing
mysql. I see in my various .cf files that access mysql that I have:
host= localhost
And reading the docs (what read the docs?), this tells postfix to
connect to mysql via the default UNIX domain socket. How does it know
what the file handle is? It seems to be working...
You need to understand certain nuances of MySQL's 'host' directive.
Most of us are used to 'localhost' and '127.0.0.1' being equivalent. In
MySQL, they aren't.
In MySQL, using host = 127.0.0.1 directs clients to connect to mysqld
via port 3306 on the loopback network interface. However, host =
localhost, as you found, instructs the client to use the Unix domain
socket instead.
If any client app that uses libmysqlclient is having trouble *finding*
that socket, the first thing to try is adding the directive 'socket =
<actual socket location>' in the [client] section of /etc/my.cnf.
So in your case, try:
[client]
host = localhost
socket = /var/lib/mysql/mysql.sock
--
Phil Stracchino
Babylon Communications
[email protected]
[email protected]
Landline: 603.293.8485