DBI connect failed : Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'

3 posts / 0 new
Last post
#1 Sun, 11/03/2019 - 07:55
NikosGr

DBI connect failed : Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'

I installed CentOS 7 + Webmin and it seemed like a good move but UNFORTUNATELY MYSQL SERVER failed again

Domains say they cannot connect to the database AND MYSQL SERVER REPORTS

"The full MySQL error message was : DBI connect failed : Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)"

i just noticed that when i

[root@superhost mysql]# cd /var/lib/mysql/ [root@superhost mysql]# rm -rf * [root@superhost mysql]# systemctl restart mariadb [root@superhost mysql]# systemctl status mariadb

then it gets ACTIVE and then i try normally to RESTORE MY DOMAINS and in the process of RESTORING via Virtualmn i get

BUT WHEN I TRY TO RESTORE A DOMAIN VIA VIRTUALMIN IT SAYS:

MySQL database failed! : mysql::execute_sql_logged failed : DBI connect failed : Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) at /usr/libexec/webmin/web-lib-funcs.pl line 1477.

PLEASE tell me exactly what you want me to try. PLEASE TELL ME HOW TO TAKE A LOOK AT WHATS HAPPENING WITH MYSQL SERVER TO FIND OUT WHY IT IS FAILING TO FIND OUT WHY IT IS FAILING. PLEASE HELP ME AS IAM TRYING REISNTALLING EVERYTHING FOR 2 DAYS AND FOR SOME REASON MARIADB FAIL TO START

THANK YOU

Sun, 11/03/2019 - 08:01
NikosGr

Our administrators have checked my VPS. in general, MySQL service is currently running and it accepts connections over SSH. From the actions taken from your side, it is possible that Webmin itself can not access MySQL. In such a case, you have to check or set up the connections for Webmin to the MySQL service again, so it would have the required access. An alternative option is to configure the Database manually over SSH, by creating the required website databases manually and importing the data into them.

PLEASE or tell me exact steps on HOW TO IT. Thank you.

Intel Inside, Idiot Outside!

Sun, 11/03/2019 - 11:55
NikosGr

I have made this change myself 10 minutes ago by running

cd /var/lib/mysql rm -rf * systemctl restart mariadb "/usr/bin/mysqladmin -u root password '******'"

after that change i have restored from backup databases for ypsilandio.gr varsa.gr

and these websites work as we speak. Shall i try to restore database for kidsclubpaidika.gr ?

Its only when i do this that mysql database server FAIIL.

What do you advise?

I have gone ahead and restored kidsclupaidika.gr database.

When the restoration finished i got once again:

The full MySQL error message was : DBI connect failed : Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)

PLEASE HELP ME.

Intel Inside, Idiot Outside!