MySQL socket location and Perl DBI::mysql

LawsHosting

Verified User
Joined
Sep 13, 2008
Messages
2,367
Location
London UK
It seems that my MySQL socket is in /usr/local/mysql/data/, which is symlink'd to /home/mysql/.... Not sure if I changed it or what.

However, a client tried to install DADAMail via Installatron, it kept failing. Initially thought it was an Apache +ExecCGI issue, but it turned out it wasn't.

So, I decided to try to manually install it and the results seem to point to the mysql.sock file. It appears that DBI::mysql wants the mysql.sock in /tmp/ (eg. https://stackoverflow.com/questions/1957916/how-do-i-tell-dbdmysql-where-mysql-sock-is )

I created a symlink from /tmp/ to /usr/local/mysql/data/, but the database test in DADA's manual installer still fails (see attached screenshot).

I even tried changing the socket location to /tmp/ but then PHP panicked and couldn't find it (mysql.default_socket / mysqli.default_socket are blank in the php.ini's). I shouldn't need to edit these, right (eg. If empty, uses the built-in MySQL defaults)?

Furthermore, systemd's mysqld.service has the --socket= argument in, so it overrides the my.cnf one. I thought I was going mad when the socket didn't move. :mad:
 

Attachments

  • mysqlsock.png
    mysqlsock.png
    13.8 KB · Views: 22
Last edited:
Update:

Crude fix is
When you specify host=localhost, mysql client will try to login to mysql server using unix named pipe which requires a .sock file.This can be bypassed by specifying host=127.0.0.1. This will make mysql client use TCP to connect to the server.
 
Pro Tip:

If you value your sanity, disable DADAMail from Installatron/Softaculous........ The sock file is the least of my worries.......
 
Back
Top