/usr/bin/mysqladmin:连接到位于';本地主机';失败
在mysql服务器上键入stop命令(/etc/init.d/mysql stop)时,我发现以下错误:/usr/bin/mysqladmin:连接到位于';本地主机';失败,mysql,mysqladmin,Mysql,Mysqladmin,在mysql服务器上键入stop命令(/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
/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
正如错误所说。。检查mysqld服务是否正在运行?我正在停止mysql服务器(/etc/init.d/mysql stop)。为什么它在mysqld关闭时告诉我这个错误?套接字文件存在
/etc/init.d/mysql status
会告诉您什么?这不是一个“我认为这可能涵盖它”的错误。服务未运行或套接字文件不存在。@索引如果您找到了问题的解决方案,请发布并将问题标记为已回答,好吗?