当向 mysql 服务器键入停止命令(/etc/init.d/mysql stop)时,我收到以下错误:
/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 停止后
/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