Can't connect to local MySQL server through socket
Hello, I have problems with my cpanel. When I log into MySQL" Databases
An error message appears:
The MySQL server is currently offline.
Error while connecting to MySQL: (XID qpf9ac) Database Connect Error: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) Error while connecting to MySQL: (XID qpf9ac) Database Connect Error: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) at /usr/local/cpanel/Cpanel/Mysql.pm line 173.
-
Your forums Access level is Website Owner, do you have root access to the server you're on? If not, you might want to speak with your Hosting Provider about this. 0 -
Your forums Access level is Website Owner, do you have root access to the server you're on? If not, you might want to speak with your Hosting Provider about this.
Hello, thanks! I have access to root yes.0 -
Can you confirm MySQL is online? In SSH simply type: # mysql
Does it bring up mysql prompt:mysql>
or throw an error? Also what does this give you:# ll /var/lib/mysql/mysql.sock
0 -
Can you confirm MySQL is online? In SSH simply type:
# mysql
Does it bring up mysql prompt:mysql>
or throw an error? Also what does this give you:# ll /var/lib/mysql/mysql.sock
I did the procedure and no error appeared.0 -
Hello, Check to see if a .my.cnf file exists under the account's home directory (/home/$username/). If so, verify it uses the correct credentials, or try updating the individual account's MySQL password after consulting with the user via: "WHM Home " SQL Services " Change MySQL User Password" Thank you. 0 -
mysql log did you check? tail -f /var/lib/mysql/hostname.err 0 -
I think you didn't started your database server, start it using #services mysql start or #/etc/init.d/mysql start If you are getting a failure message while starting, check the log file (/var/log/syslog), if you found socket connection error message there, then check for correct socket file location #find / -type s, if you found a mysqld.sock file under /var/run/mysqld/ directory, check whether any instances of mysqld running or not #netstat -anpt | grep 3306 or #ps aux | grep mysqld if you found any running process stop it (#kill -9 pid) and remove the socket file. Then try to restart it and if mysql not creating socket file then try start it like #/usr/sbin/mysqld --defaults-file=/etc/mysql/my.cnf --basedir=/usr --datadir=/var/lib/mysql --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/run/mysqld/mysqld.sock Also check your my.cnf file (/etc/mysql/my.cnf) and comment the bind-address field, and if you found any skip-network field comment it. 0
Please sign in to leave a comment.
Comments
7 comments