Mysql problem: no mysql.sock

Yesterday I was working with MySQL installed on my computer.
I downloaded xampp, so I changed the socket path to my.cnf file:

  /opt/lampp/var/mysql/mysql.sock 

This file was there. Today I wanted to continue working on this, and I found that this file is no longer there, so I run the following error when starting the mysql server:

 ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/opt/lampp/var/mysql/mysql.sock' (2) 

Here are some tests I have done:

 mujeresponja@ubuntu :~$ ps -fea | grep mysqld 1000 15707 15615 0 16:28 pts/1 00:00:00 grep --color=auto mysqld mujeresponja@ubuntu :~$ ps -fea | grep mysql 1000 15709 15615 0 16:29 pts/1 00:00:00 grep --color=auto mysql 

As a possible solution, I uninstalled xampp and reinstalled it, as well as a new MySQL server just in case. In any case, this file is no longer there.

EDIT Where mysql.sock should be, instead there are two mysql_upgrade_info files (which contains only 5.5.8) and another binary called ubuntu.err:

 mujeresponja@ubuntu :/opt/lampp/var/mysql$ sudo cat ubuntu.err 110403 17:28:52 mysqld_safe Starting mysqld daemon with databases from /opt/lampp/var/mysql 110403 17:28:52 [Note] Plugin 'FEDERATED' is disabled. /opt/lampp/sbin/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13) 110403 17:28:52 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it. InnoDB: The InnoDB memory heap is disabled InnoDB: Mutexes and rw_locks use InnoDB own implementation InnoDB: Compressed tables use zlib 1.2.3 110403 17:28:52 InnoDB: Initializing buffer pool, size = 16.0M 110403 17:28:52 InnoDB: Completed initialization of buffer pool 110403 17:28:52 InnoDB: Operating system error number 13 in a file operation. InnoDB: The error means mysqld does not have the access rights to InnoDB: the directory. InnoDB: File name /opt/lampp/var/mysql/ibdata1 InnoDB: File operation call: 'create'. InnoDB: Cannot continue operation. 110403 17:28:52 mysqld_safe mysqld from pid file /opt/lampp/var/mysql/ubuntu.pid ended 110403 17:29:22 mysqld_safe Starting mysqld daemon with databases from /opt/lampp/var/mysql 110403 17:29:22 [Note] Plugin 'FEDERATED' is disabled. /opt/lampp/sbin/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13) 110403 17:29:22 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it. InnoDB: The InnoDB memory heap is disabled InnoDB: Mutexes and rw_locks use InnoDB own implementation InnoDB: Compressed tables use zlib 1.2.3 110403 17:29:22 InnoDB: Initializing buffer pool, size = 16.0M 110403 17:29:22 InnoDB: Completed initialization of buffer pool 110403 17:29:22 InnoDB: Operating system error number 13 in a file operation. InnoDB: The error means mysqld does not have the access rights to InnoDB: the directory. InnoDB: File name /opt/lampp/var/mysql/ibdata1 InnoDB: File operation call: 'create'. InnoDB: Cannot continue operation. 110403 17:29:22 mysqld_safe mysqld from pid file /opt/lampp/var/mysql/ubuntu.pid ended 

(Sorry, I don’t know how to display terminal messages accordingly) Can someone help me with this? Thanks in advance!

+3
source share
5 answers

You can find the actual socket file and create a symbolic link leading to it as follows:

 # check path to socket from mysql settings mysqladmin | grep d.sock # create a symbolic link ln -s path_to_mysql_socket /opt/lampp/var/mysql/mysql.sock 
+6
source

Although the test you did is a bit distorted, Im going to assume that the test just proves that mysql is not working.

Depending on how mysql itself is configured, there should be a boot file somewhere, usually around /etc/rc.* directories, and you will need to start rc.mysql (or it could be S<nn>MySQL in for example, rc3.d directory

+1
source

I did not find a specific reason for my problem. I just unisntalled and reinstalled, and then everything went well.
This is not a real solution, but it worked. Good luck.

+1
source

I came to the same situation when I made a grant *. * to another user. Mysql tried to grant permissions for the mysql database, and this caused a disaster: instantly the mysql.sock file disappeared.

this happened with version 5.6

0
source

I had the same problem with you and I found some useful information:

 2015-08-14 10:51:17 30934 [ERROR] InnoDB: Unable to lock /opt/lampp/var/mysql/ibdata1, error: 11 2015-08-14 10:51:17 30934 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 

So, I rebooted the computer and restarted XAMPP, and the problem was resolved.

0
source

Source: https://habr.com/ru/post/979672/


All Articles