Hi,
I rebooted my server and now I'm having a problem with mysql. In DirectAdmin I'm getting the following error (in DA/User/MySQL Databases):
Error connecting to MySQL: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
If I go to phpMyAdmin I get the same error after logging in:
#2002 - Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
The server is not responding (or the local server's socket is not correctly configured).
I've had a look at the /tmp folder and there is no mysql.sock file there.
I've SSH'd as root and looked into the problem and I have noticed that the folder /etc/mysql doesn't exist. I see a folder called mysql.moved which contains the my.cnf file. I copied it to /etc/mysql as I think it should be in that location.
I ran the command find -name mysql.sock and have no results.
root@server:/var/lib/mysql# ps aux | grep mysql
I looked in /var/run/mysqld but mysqld.sock doesn't exist in that location there is only the mysqld.pid file in there).
I have read this:
http://www.tech-recipes.com/rx/762/...cal-mysql-server-through-socket-tmpmysqlsock/
But I'm not sire it helped as there is no mysqld.sock file I can see.
I've read a few other posts on the matter but haven't found a solution to this problem. This was the first reboot to this machine. My biggest concern is why/how this happened?
I rebooted my server and now I'm having a problem with mysql. In DirectAdmin I'm getting the following error (in DA/User/MySQL Databases):
Error connecting to MySQL: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
If I go to phpMyAdmin I get the same error after logging in:
#2002 - Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
The server is not responding (or the local server's socket is not correctly configured).
I've had a look at the /tmp folder and there is no mysql.sock file there.
I've SSH'd as root and looked into the problem and I have noticed that the folder /etc/mysql doesn't exist. I see a folder called mysql.moved which contains the my.cnf file. I copied it to /etc/mysql as I think it should be in that location.
I ran the command find -name mysql.sock and have no results.
Code:
root@server:/# /etc/init.d/mysqld stop
Stopping mysqld: [ FAILED ]
root@server:/# /etc/init.d/mysqld start
Starting mysqld: [ OK ]
root@server:/#
root@server:/var/lib/mysql# ps aux | grep mysql
Code:
root 1560 0.0 0.0 9140 1396 ? S Jun15 0:00 /bin/sh /usr/bin/mysqld_safe
mysql 1691 0.0 0.1 168728 22608 ? Sl Jun15 0:14 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.pid [B]--socket=/var/run/mysqld/mysqld.sock --port=3306[/B]
root 1692 0.0 0.0 3856 628 ? S Jun15 0:00 logger -t mysqld -p daemon.error
root 3207 0.0 0.0 7548 860 pts/0 S+ 04:23 0:00 grep mysql
I looked in /var/run/mysqld but mysqld.sock doesn't exist in that location there is only the mysqld.pid file in there).
I have read this:
http://www.tech-recipes.com/rx/762/...cal-mysql-server-through-socket-tmpmysqlsock/
But I'm not sire it helped as there is no mysqld.sock file I can see.
I've read a few other posts on the matter but haven't found a solution to this problem. This was the first reboot to this machine. My biggest concern is why/how this happened?