网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

MySQL5.5关闭数据库报错"Can'tconnecttolocalMySQLserverthroughsocket"怎么办

本篇内容介绍了“MySQL5.5关闭数据库报错"Can't connect to local MySQL server through socket"怎么办”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!

我们提供的服务有:做网站、成都网站建设、微信公众号开发、网站优化、网站认证、连平ssl等。为上千企事业单位解决了网站和推广的问题。提供周到的售前咨询和贴心的售后服务,是有科学管理、有技术的连平网站制作公司

MySQL 5.5 关闭数据库报错

[root@localhost ~]# /software/bin/mysqladmin -usystem -p'system' shutdown
/software/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/cluster_data/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/cluster_data/mysql.sock' exists!

报错原因:
数据库之前使用过其他的socket

解决方法:
关闭数据库命令参数中,指定现有的socket名字

查看现有的socket
[root@localhost ~]# ps -ef|grep mysql
root      2487  2462  0 08:13 ?        00:00:00 /bin/sh /software/bin/mysqld_safe --defaults-file=/mysql_data/cnf/my.cnf
mysql     3057  2487  0 08:14 ?        00:00:00 /software/bin/mysqld --defaults-file=/mysql_data/cnf/my.cnf --basedir=/software --datadir=/mysql_data/70005 --plugin-dir=/software/lib/plugin --user=mysql --log-error=/mysql_log/err.log --open-files-limit=10240 --pid-file=/mysql_data/70005/mysqld.pid --socket=/mysql_data/70005/mysql.sock --port=55057
root      3092  3026  0 08:14 pts/1    00:00:00 grep mysql

[root@localhost ~]# /software/bin/mysqladmin -?|grep sock
  --protocol=name     The protocol to use for connection (tcp, socket, pipe,
  -S, --socket=name   The socket file to use for connection.
socket                            /cluster_data/mysql.sock

正常关闭数据库
[root@localhost ~]# /software/bin/mysqladmin -usystem -p'system' shutdown --socket=//mysql_data/70005/mysql.sock 

“MySQL5.5关闭数据库报错"Can't connect to local MySQL server through socket"怎么办”的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识可以关注创新互联网站,小编将为大家输出更多高质量的实用文章!


分享名称:MySQL5.5关闭数据库报错"Can'tconnecttolocalMySQLserverthroughsocket"怎么办
URL网址:http://bjjierui.cn/article/pjpdhc.html

其他资讯