LMSouq
server-admin Open

Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (38)

LA
Lambivist
1 month ago
3 views
Problem Description
I am having a big problem trying to connect to mysql. When I run: <!-- language: shell --> /usr/local/mysql/bin/mysql start I have the following error : <!-- language: none --> Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (38) I do have `mysql.sock` under the `/var/mysql` directory. In `/etc/my.cnf` I have: <!-- language: none --> [client] port=3306 socket=/var/mysql/mysql.sock [mysqld] port=3306 socket=/var/mysql/mysql.sock key_buffer_size=16M max_allowed_packet=8M and in `/etc/php.ini` I have : <!-- language: ini --> ; Default socket name for local MySQL connects. If empty, uses the built-in ; MySQL defaults. mysql.default_socket = /var/mysql/mysql.sock I have restarted apache using `sudo /opt/local/apache2/bin/apachectl restart` But I still have the error. Otherwise, I don't know if that's relevant but when I do `mysql_config --sockets` I get <!-- language: none --> --socket [/tmp/mysql.sock]

AI-Generated Solution

Powered by LMSouq AI · GPT-4.1-mini

✓ Solution Ready
Analyzing problem and generating solution…
Was this solution helpful?
Back to Knowledge Base