当键入stop命令(/etc/init.d/mysql stop)到mysql服务器时,我收到以下错误:
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
尽管错误,mysqld停止了。 你能帮我理解它试图做什么以及如何解决这个错误吗?
查看/etc/init.d/mysql脚本并尝试使用mysqladmin手动运行命令:
/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf shutdown 2
它没有任何输出它工作正常。 mysqld停了。
/etc/init.d/mysql stop
之后/etc/init.d/mysql status
* MySQL is stopped.
当mysqld运行时:
/etc/init.d/mysql status
* /usr/bin/mysqladmin Ver 8.41 Distrib 5.0.51a, for debian-linux-gnu on x86_64Copyright (C) 2000-2006 MySQL AB
This software comes with ABSOLUTELY NO WARRANTY. This is free software,and you are welcome to modify and redistribute it under the GPL license
Server version 5.0.51a-3ubuntu5.7
Protocol version 10
Connection Localhost via UNIX socket
UNIX socket /var/run/mysqld/mysqld.sock
Uptime: 4 sec
Threads: 2 Questions: 71 Slow queries: 0 Opens: 55 Flush tables: 1 Open tables: 49 Queries per second avg: 17.750