RES: How to use mysql.

Quentin Stafford-Fraser quentin at pobox.com
Tue Jan 31 03:07:14 EST 2012


On 31 Jan 2012, at 02:24, gnucash-user-request at gnucash.org wrote:

> "127.0.0.1" IS "localhost". "localhost" is just an alias for it. 
> ...
> Why it would be necessary to use the formal notation instead of the alias will 
> remain a mystery.

Yes, this is in general true. However, when MySQL is making the connection to the database, on Unix systems at least, if there is no host specified, or the host is 'localhost', it will attempt to connect using Unix domain sockets, because these are more efficient  If anything else is specified, including 127.0.0.1, it will make a TCP connection.

So for MySQL, the two are not quite equivalent. And since Unix domain sockets live at a particular location in the file system, they can fail if a directory doesn't exist, for example.  Another possibility is that you have more than one MySQL installation on a machine, and the server is configured to use a socket at one location while the client libraries default to another.

I'm afraid I can't remember enough of the original post to know whether that might be the issue, but it's worth knowing about anyway!

Quentin




More information about the gnucash-user mailing list