I have a problem that has been keeping me puzzled since I installed my OSX "Server" in October:
When I restart my server, postfix cannot connect to Dovecot. This it turns out, is related to that postgrey cannot ponnect to the database.
For some reason, sqlgrey is trying to connect to the socket (I assume) /tmp/mysql.sock!
The workaround for this is simple, just create a link from the socket file /private/var/mysql/mysql.sock to /tmp/mysql.sock using:
"ln /private/var/mysql/mysql.sock /tmp/mysql.sock".
The disadvantage of this, is that /tmp is emptied on every restart of the server, so I have to manually run this command after each restart.
But WHY is this happening? Looking in my sqlgrey.conf, I have the following connection settings:
db_type = mysql
db_name = sqlgrey
# Note: the following are not used with SQLite
db_host = localhost
db_port = default
Which is the same as any other component that uses MySQL on the system, and all other works fine!
I have tried to change the location of the mysql.sock file, but that basically causes all other components to fail :-(
Is there a hidden setting in perl (which sqlgrey is built upon), which points to an alternative mysql location?
Alternatively how can I prevent OSX from deleting the /tmp/mysql.sock link on shutdown?
What I see in my system.log file is this:
Apr 4 10:38:52 Minin com.diymacserver.sqlgrey: dbaccess: can't connect to DB: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
Apr 4 10:38:52 Minin com.diymacserver.sqlgrey: dbaccess: error: couldn't get now() from DB: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
Jan, which version of MySQl have you got installed and are you running a real OSX server or our DIYMacServer?
Also, I forgot, do you have a MYSQL config file in /etc/ called my.cnf
After some googling I found that Perl uses the MYSQL config file to determine the connection or socket settings in the config file.
Otherwise we need to change the code to make a database connection look like:
Hi Richard, thanks for your responses, your help is highly appreciated!
I'm running an DIY server, the only thing that is not according to your guides, is the MySQL, which I downloaded and installed of the MySQL website back in October, just before I found your excellent website.
The version is Server version: 5.1.51 MySQL Community Server
the my.cfn is located in /private/etc/my.cnf and the content is:
socket = /var/mysql/mysql.sock
socket = /var/mysql/mysql.sock
And if I understand you correct, this is the setting that SQLGrey should pick up, just as the rest of the components does correctly. Right?
If I'm to change the connection setting, where should I do that? In my amateur eyes, this all seems just about right... Maybe I'm looking in the wrong place?
Jan did you enable the skip-networking option in MySQL so it can only use the socket for connectivity?
No, Skip-networking is not enabled.
On the other hand, neither is "port", could that be a problem? I guess not, at least not related to this...
I'll see if I can reproduce your problem to be able to determine a solution.
That's really great service. I hope you will be able to find a clue somewhere, as I have ran my forehead against the wall one to many time now!
You must log in to post.
Register or log in:
powered by bbPress