My mySQL server on CentOS is working correctly, but today I can not restart mysqld.
1) # / etc / rc.d / init.d / mysqld start
shows [failed]
2) see the magazine
tail /var/log/mysqld.log
.
.
mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
3) manually place
/usr/bin/mysqld_safe
151129 15:54:36 mysqld_safe Logging to '/var/log/mysqld.log'.
151129 15:54:37 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
151129 15:54:37 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
4) check the configuration
less /etc/my.cnf
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
symbolic-links=0
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
5) check the mysql directory, each owner ship is owned by mysql. However, I cannot distinguish mysql.sock (this is set in my.cnf)
cd /var/lib/mysql
ls -la
drwxr-xr-x 5 mysql mysql 4096 11月 29 15:54 2015 .
drwxr-xr-x 21 root root 4096 6月 2 06:09 2015 ..
-rw-rw
drwx
-rw-rw
-rw-rw
-rw-rw
drwx
drwx
6) I found that in the directory / var / lib / mysql there is no mysql.sock in the directory / var / lib / mysql, then I will try this for testing purposes.
touch /var/lib/mysql/mysql.sock
try rebooting
/etc/rc.d/init.d/mysqld start
somehow mysql.sock is deleted.
Are there any other things I can try?
source
share