T
T
TANK_IST2013-12-08 02:44:20
PHP
TANK_IST, 2013-12-08 02:44:20

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.

PDO:
SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

Support says that these are my problems, they say, and decide for yourself.
What to do? And how to make a backup if you have to reinstall MySql?

Answer the question

In order to leave comments, you need to log in

6 answer(s)
V
Vladimir Yakimov, 2013-12-08
@cookie

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

If mysql has loaded try to connect from the console:
If the connection was successful, exit the console client "quit" check if the socket has been created in the directory /var/run/mysqld/mysqld.sock If
the socket is not in the directory, you need to search for it with the command:
directory other than /var/run/mysqld/mysqld.sock, you need to specify a new socket location in the php.ini settings:
pdo_mysql.default_socket=
mysql.default_socket =
mysqli.default_socket =

N
nochkin, 2013-12-08
@nochkin

Maybe just restart MySQL?
It looks like it is not running or has crashed.

V
Vlad Zhivotnev, 2013-12-08
@inkvizitor68sl

Get an admin. You can guess for a long time.

E
Eugene, 2013-12-08
@Nc_Soft

See error log, presumably in /var/db/mysql file with .err resolution

I
igorgabby, 2017-09-23
@igorgabby

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)

B
bl, 2017-11-27
@vl12

Create this file:

sudo mkdir /var/run/mysqld
sudo mkfifo /var/run/mysqld/mysqld.sock
sudo chown -R mysql /var/run/mysqld

Check: mysql -u root -p
It will most likely give a permissions error. Disable ban for "root" user:
$ sudo -i
$ echo "update user set plugin='' where User='root'; flush privileges;" | mysql -u root -p mysql

Restart mysql: sudo service mysql restart
softodom.com/516/mysql-cant-connect-through-socket...
https://losst.ru/ustanovka-lamp-ubuntu-16-04

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question