• You MUST read the Babiato Rules before making your first post otherwise you may get permanent warning points or a permanent Ban.

    Our resources on Babiato Forum are CLEAN and SAFE. So you can use them for development and testing purposes. If your are on Windows and have an antivirus that alerts you about a possible infection: Know it's a false positive because all scripts are double checked by our experts. We advise you to add Babiato to trusted sites/sources or disable your antivirus momentarily while downloading a resource. "Enjoy your presence on Babiato"

[need help] Error establishing a database connection

Sashidhar073

Well-known member
Babiato Lover
Trusted Seller
Banned User
Jul 7, 2020
431
342
63
India
Im getting "
Warning: mysqli_real_connect(): (HY000/2002): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /home/trc4gtr0azhv/public_html/wp-includes/wp-db.php on line 1653

Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
Error establishing a database connection
"

this error..

phpmy admin is not opening and MySQL data base is also throwing error "
Error while connecting to MySQL: (XID aa4ucu) The system failed to connect to the “MySQL” database “mysql” because of an error: CR_CONNECTION_ERROR (Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)) Error while connecting to MySQL: (XID aa4ucu) The system failed to connect to the “MySQL” database “mysql” because of an error: CR_CONNECTION_ERROR (Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)) at /usr/local/cpanel/Cpanel/Mysql/Basic.pm line 391, <STDIN> line 1." my SQL is offline

MySQL is offline


any help pls,
 
For your first error this what i found on google
Are you connecting to "localhost" or "127.0.0.1" ? I noticed that when you connect to "localhost" the socket connector is used, but when you connect to "127.0.0.1" the TCP/IP connector is used. You could try using "127.0.0.1" if the socket connector is not enabled/working.
 
What kind of hosting you are on? if this is a shared webhosting contact your provider and tell him that mysql is down
if you are using a VPN you'll have to restart mysql
 
What kind of hosting you are on? if this is a shared webhosting contact your provider and tell him that mysql is down
if you are using a VPN you'll have to restart mysql
this is godaddy hosting, they are not even responding.
 
For your first error this what i found on google
Are you connecting to "localhost" or "127.0.0.1" ? I noticed that when you connect to "localhost" the socket connector is used, but when you connect to "127.0.0.1" the TCP/IP connector is used. You could try using "127.0.0.1" if the socket connector is not enabled/working.
how to do it?
Assuming that you have a linux shared hosting (most have that only). Here's the link for instructions to enable ssh.


After you have your credentials download ssh software called putty and login with these credentials and run the command

sudo systemctl start mysql

Alternatively, you can contact and request your hosting provider to restart mysql. Or, you may look for option to restart mysql in cpanel. I have not used shared GoDaddy shared hosting for a long time, so not sure if they have that option.
 
  • Like
Reactions: Simbaa
Assuming that you have a linux shared hosting (most have that only). Here's the link for instructions to enable ssh.


After you have your credentials download ssh software called putty and login with these credentials and run the command

sudo systemctl start mysql

Alternatively, you can contact and request your hosting provider to restart mysql. Or, you may look for option to restart mysql in cpanel. I have not used shared GoDaddy shared hosting for a long time, so not sure if they have that option.


Thanks man, it worked :)
 
  • Like
Reactions: Simbaa
AdBlock Detected

We get it, advertisements are annoying!

However in order to keep our huge array of resources free of charge we need to generate income from ads so to use the site you will need to turn off your adblocker.

If you'd like to have an ad free experience you can become a Babiato Lover by donating as little as $5 per month. Click on the Donate menu tab for more info.

I've Disabled AdBlock