[need help] Error establishing a database connection

  • 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"

Sashidhar073

Well-known member
Trusted Seller
Jul 7, 2020
379
343
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,
 

yassine2217

Member
Feb 17, 2021
95
36
18
Casablanca
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.
 

shady

New member
May 11, 2020
5
0
1
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
 

Sashidhar073

Well-known member
Trusted Seller
Jul 7, 2020
379
343
63
India
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.
 

rajujha

Member
Jul 24, 2019
59
9
8
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: yassine2217

Sashidhar073

Well-known member
Trusted Seller
Jul 7, 2020
379
343
63
India
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: yassine2217

Similar threads

Forum statistics

Threads
49,993
Messages
549,421
Members
135,267
Latest member
Sofiajones_898
AdBlock Detected

We get it, advertisements are annoying!

Sure, ad-blocking software does a great job at blocking ads, but it also blocks useful features of our website. For the best site experience please disable your AdBlocker.

I've Disabled AdBlock    No Thanks