Answer the question
In order to leave comments, you need to log in
Why is MySql database not working?
On the server where I have a VPS yesterday, a DDOS attack was carried out and failures occurred. After that, MySql stopped working for me.
phpmyadmin:
#2002 Unable to connect to MySQL server
Error while specifying connection for controluser in configuration.
SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Answer the question
In order to leave comments, you need to log in
The first thing to do is to restart the server:
After the reboot, see if mysql has loaded:
If mysql has not loaded, then look in the logs for the reason why it did not load:
/var/log/mysql/error.log
/var/log/syslog
/var/log/messages
sometimes /var/lib/mysql/error.log
pdo_mysql.default_socket=
mysql.default_socket =
mysqli.default_socket =
Maybe just restart MySQL?
It looks like it is not running or has crashed.
I had the same problem, I suffered for a long time, in the end I realized that mysqld.exe did not start.
I realized that you need to start the unpacked server using the command line:
to shut down the server, use:
These exe files are located in the folder with your server in the bin directory.
You can also try installing MySQLInstaller to work with the MySQL server , it can replace the unpacking of the server from the archive with an installation with a convenient interface.
HERE IS THE LINK TO MySQLInstaller : dev.mysql.com/downloads/windows/installer/5.6.html
(On the site, at first it seems that you can’t install without registration, but there is a button below " No thanks, just start my download .")
+
(It is indicated that MySQLInstaller is 32-bit, but later you can install 64-bit server in the same program)
Create this file:
sudo mkdir /var/run/mysqld
sudo mkfifo /var/run/mysqld/mysqld.sock
sudo chown -R mysql /var/run/mysqld
mysql -u root -p
$ sudo -i
$ echo "update user set plugin='' where User='root'; flush privileges;" | mysql -u root -p mysql
sudo service mysql restart
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question