MySQL 5.5 關閉資料庫報錯"Can't connect to local MySQL server through socket"
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
[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
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26506993/viewspace-2104461/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- MySQL連線提示Can't connect to local MySQL server through socketMySqlServer
- Can't connect to local MySQL server through socket '/tmp/mysql.sock'MySqlServer
- Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock錯誤MySqlServer
- mysql 啟動報錯Can't connect to local MySQL server through socket '/data/mysql/mysql/mysql.sock'(111)MySqlServer
- 解決Can 't connect to local MySQL server through socket '/tmp/mysql.sock '(2) "MySqlServer
- MySQL報錯'ERROR 2002 (HY000): Can't connect to local MySQL server through'MySqlErrorServer
- Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)解決方法MySqlServer
- mysqldump: Got error: 2002: Can't connect to local MySQL server through.....MySqlGoErrorServer
- linux下連線mysql報錯ERROR 2002 (HY000): Can‘t connect to local MySQL server through socket ‘/var/lib/mysqLinuxMySqlErrorServer
- MySQL 5.5 原始碼安裝報錯"[ERROR] Can't start server"MySql原始碼ErrorServer
- 更換mysql資料目錄後出現ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) 的解決辦法MySqlErrorServer
- ERROR 2002(HY000):Can't connect to local MySQL socket '/tmp/mysql.sock'ErrorMySql
- 連線MySQL錯誤:Can't connect to MySQL server (10060)MySqlServer
- ERROR 2002 (HY000): Cant connect to local MySQL server through socket的解決方法ErrorMySqlServer
- Mysql 5.5 資料庫啟動關閉命令MySql資料庫
- ERROR 2002 (HY000): Can't connect server socket /tmp/mysql.sockErrorServerMySql
- 異常:Can't connect to MySQL server (10060)MySqlServer
- MySQL 2003 - Can’t connect to MySQL server on (10060)MySqlServer
- MySQL 5.5原始碼安裝時啟動資料庫報錯"Table 'mysql.user' doesn't exist??"MySql原始碼資料庫
- mysql [ERROR] Can't create IP socket: Permission deniedMySqlError
- MySQL問題記錄--Can't connect to MySQL server on localhost (10061)解決方法MySqlServerlocalhost
- Mysql報錯Fatal error:Can't open and lock privilege tablesMySqlError
- Can't Connect to MySQL Server on IP Address (10061) 錯誤的解決方案MySqlServer
- Xtrabackup備份報錯Failed to connect to MySQL serverAIMySqlServer
- mysql can't connect error about privilege----not root userMySqlError
- 【linux】Can't connect to MySQL server on 'XXX' (13)問題解決方式LinuxMySqlServer
- Navicat連線centos裡mysql報錯Host is not allowed to connect to this MySQL serverCentOSMySqlServer
- MySQL 建立外來鍵報錯Can't write; duplicate key in tableMySql
- MySQL報錯Table 'plugin' is read only [ERROR] Can't open the mysql.plugin table.MySqlPluginError
- [jenkins]Can’t connect to window server – not enough permissionsJenkinsServer
- ERROR 2003 (HY000)Can't connect to MySQL server on '192.168.8.247' (113)ErrorMySqlServer
- ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)ErrorMySqlServerlocalhost
- MYSQL報1022錯誤:Can't write;duplicate key in table '.....'MySql
- MySQL不能啟動 Can't start server : Bind on unix sockeMySqlServer
- Can't connect to X11 window server usingServer
- mysql報CanMySql
- mysql匯入報錯Variable 'sql_notes' can't be set to the value of 'NULL'MySqlNull
- MySQL 5.5初始化資料庫報錯FATAL ERROR: Could not find my_print_defaultsMySql資料庫Error