共計(jì) 1538 個(gè)字符,預(yù)計(jì)需要花費(fèi) 4 分鐘才能閱讀完成。
行業(yè)資訊
數(shù)據(jù)庫(kù)
MySQL 數(shù)據(jù)庫(kù)
MySQL5.5 關(guān)閉數(shù)據(jù)庫(kù)報(bào)錯(cuò) Can t connect to local MySQL server through socket 怎么辦
本篇內(nèi)容介紹了“MySQL5.5 關(guān)閉數(shù)據(jù)庫(kù)報(bào)錯(cuò) Can t connect to local MySQL server through socket 怎么辦”的有關(guān)知識(shí),在實(shí)際案例的操作過(guò)程中,不少人都會(huì)遇到這樣的困境,接下來(lái)就讓丸趣 TV 小編帶領(lǐng)大家學(xué)習(xí)一下如何處理這些情況吧!希望大家仔細(xì)閱讀,能夠?qū)W有所成!
MySQL 5.5 關(guān)閉數(shù)據(jù)庫(kù)報(bào)錯(cuò)
[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!
報(bào)錯(cuò)原因:
數(shù)據(jù)庫(kù)之前使用過(guò)其他的 socket
解決方法:
關(guān)閉數(shù)據(jù)庫(kù)命令參數(shù)中,指定現(xiàn)有的 socket 名字
查看現(xiàn)有的 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
正常關(guān)閉數(shù)據(jù)庫(kù)
[root@localhost ~]# /software/bin/mysqladmin -usystem -p system shutdown –socket=//mysql_data/70005/mysql.sock
“MySQL5.5 關(guān)閉數(shù)據(jù)庫(kù)報(bào)錯(cuò) Can t connect to local MySQL server through socket 怎么辦”的內(nèi)容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業(yè)相關(guān)的知識(shí)可以關(guān)注丸趣 TV 網(wǎng)站,丸趣 TV 小編將為大家輸出更多高質(zhì)量的實(shí)用文章!