ERREUR 2002 (HY000) :
Solved
lemaire
-
IALY -
IALY -
Hello,
when I try to restart MySQL on Linux, I get this error: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
could you help me?
thank you for your response
lemaire
when I try to restart MySQL on Linux, I get this error: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
could you help me?
thank you for your response
lemaire
15 réponses
In my opinion, there is an error or inconsistency in /etc/mysql/my.cnf if you don't have the file /var/run/mysqld/mysqld.sock.
Typically, you should have something like this:
Backup /etc/mysql/my.cnf beforehand, just in case.
To regenerate this file, you can reinstall the package. Normally, under Debian/Ubuntu, you just need to run:
If that doesn't change anything, reinstall the package. For example, under Debian, Ubuntu, etc...
Good luck.
Typically, you should have something like this:
.... # This was formally known as [safe_mysqld]. Both versions are currently parsed. [mysqld_safe] socket = /var/run/mysqld/mysqld.sock nice = 0 [mysqld] # # * Basic Settings # user = mysql pid-file = /var/run/mysqld/mysqld.pid socket = /var/run/mysqld/mysqld.sock port = 3306 basedir = /usr datadir = /var/lib/mysql tmpdir = /tmp language = /usr/share/mysql/english skip-external-locking ...
Backup /etc/mysql/my.cnf beforehand, just in case.
To regenerate this file, you can reinstall the package. Normally, under Debian/Ubuntu, you just need to run:
sudo dpkg-reconfigure mysql-server sudo service mysql restart
If that doesn't change anything, reinstall the package. For example, under Debian, Ubuntu, etc...
sudo apt-get update sudo apt-get install aptitude sudo aptitude update sudo aptitude safe-upgrade sudo rm /etc/mysql/my.cnf sudo aptitude reinstall mysql-server
Good luck.
I have already installed my network services such as: MySQL, Apache, LDAP, DHCP, Samba, DNS via the command yum install service name
and every time I open the terminal I have to type the following command: mount -o loop /dev/cdrom /mnt/iso/rhel5
Now I would like to know how to check if MySQL exists, how to start it, and how to verify if the connection works.
I tried to start the server as you indicated with the command /etc/init.d/mysql start (as root)
but it gives me the following message: permission denied.
https://forums.commentcamarche.net/forum/linux-unix-13
and each time I open the terminal I have to type the following command: mount -o loop /dev/cdrom /mnt/iso/rhel5
Why? Because the packages you are installing are downloaded from a CD?
Now I would like to know how to check if MySQL exists, how to start it and test the connection if it works.
but it returns the following message: permission denied
You need to run it as root.
Good luck
It helped me, thank you