Comments - Missing mysqld.sock file?

12 years, 3 months ago Francois Mayolle

Hello,

I tried to install MariaDB on an Ubuntu 11.10 amd64 OS, following step by step process provided at "Installing MariaDB .deb Files/Installing MariaDB using APT" (installation log available if needed).

Then when trying to run "mysql" an error message said: "ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)".

"mysqld" command prompted: "120102 11:07:43 [Warning] Can't create test file /var/lib/mysql/francois-sacesosi.lower-test - mysqld: Can't change dir to '/var/lib/mysql/' (Errcode: 2) - 120102 11:07:43 [ERROR] Aborting - 120102 11:07:43 [Note] mysqld: Shutdown complete"

I tried to changed path to /tmp/mysql.sock within "my.cnf" file, but in fact there is "mysql.sock" or "mysqld.sock" file nowhere!

Also tried to run command "sudo apt-get install socket", but it did not change anything (while socket package was apparently installed).

I would appreciate some hint on the way to fix it (please keep it very simple as I am not an IT expert).

Thanks in advance for your help... and Happy New Year to the AskMonty community!

 
12 years, 3 months ago Daniel Bartholomew

The mysql.sock file is created when MariaDB starts and is removed when MariaDB is shutdown. It won't exist if MariaDB is not running.

I've had issues with finding the socket file once when I accidentally had multiple conflicting my.cnf files. Check to see if you have multiple my.cnf files on your system. Common locations include:

  • /etc/mysql/my.cnf (MariaDB default)
  • /etc/my.cnf
  • ~/.my.cnf
 
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.