MySQL連線提示Can't connect to local MySQL server through socket
一般提示這個原因有兩個:
一:mysql服務未正常執行:
由於mysql的socket檔案是由mysqld服務啟動時建立的,如果mysqld服務未正常啟動,socket檔案也就不會被建立,當然會找不到socket檔案了。對於判斷mysql服務是否啟動,可以使用下面命令檢視mysqld程式在不在
-
[root@oracle11gtest ~]# ps -ef |grep mysqld
-
root 10452 7880 0 14:26 pts/0 00:00:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --defaults-file=/etc/my.cnf
- mysql 10939 10452 0 14:26 pts/0 00:00:04 /usr/local/mysql/bin/mysqld --defaults-file=/etc/my.cnf --basedir=/usr/local/mysql --datadir=/alidata1/mysqldata/3306/data/ --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/alidata1/mysqldata/3306/mysql_error.log --open-files-limit=10240 --pid-file=/alidata1/mysqldata/3306/mysql.pid --socket=/alidata1/mysqldata/3306/mysql.sock --port=3306
二:檢查配置檔案裡面的socket路徑是否配置正確,比如
-
[root@oracle11gtest ~]# more /etc/my.cnf
-
[client]
-
port=3306
- socket=/alidata1/mysqldata/3306/mysql.sock
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/20893244/viewspace-2133284/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Can't connect to local MySQL server through socket '/tmp/mysql.sock'MySqlServer
- 解決Can 't connect to local MySQL server through socket '/tmp/mysql.sock '(2) "MySqlServer
- Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock錯誤MySqlServer
- MySQL 5.5 關閉資料庫報錯"Can't connect to local MySQL server through socket"MySql資料庫Server
- 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 '/var/lib/mysql/mysql.sock' (111)解決方法MySqlServer
- linux下連線mysql報錯ERROR 2002 (HY000): Can‘t connect to local MySQL server through socket ‘/var/lib/mysqLinuxMySqlErrorServer
- mysqldump: Got error: 2002: Can't connect to local MySQL server through.....MySqlGoErrorServer
- MySQL報錯'ERROR 2002 (HY000): Can't connect to local MySQL server through'MySqlErrorServer
- 連線MySQL錯誤:Can't connect to MySQL server (10060)MySqlServer
- ERROR 2002(HY000):Can't connect to local MySQL socket '/tmp/mysql.sock'ErrorMySql
- 更換mysql資料目錄後出現ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) 的解決辦法MySqlErrorServer
- ERROR 2002 (HY000): Cant connect to local MySQL server through socket的解決方法ErrorMySqlServer
- 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遠端連線 Host * is not allowed to connect to this MySQL serverMySqlServer
- 連線mysql時提示is not allowed to connect不允許連線MySql
- mysql [ERROR] Can't create IP socket: Permission deniedMySqlError
- MySQL問題記錄--Can't connect to MySQL server on localhost (10061)解決方法MySqlServerlocalhost
- mysql can't connect error about privilege----not root userMySqlError
- Navicat 連線 MySQL 失敗:2002-can‘t connect to server on localhost(10061)問題解決MySqlServerlocalhost
- Navicat連線centos裡mysql報錯Host is not allowed to connect to this MySQL serverCentOSMySqlServer
- 【linux】Can't connect to MySQL server on 'XXX' (13)問題解決方式LinuxMySqlServer
- [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
- 116 svn連線提示can't connect to the host'***':由於目標機積極拒絕,無法連線。
- MySQL不能啟動 Can't start server : Bind on unix sockeMySqlServer
- Can't connect to X11 window server usingServer
- Can't Connect to MySQL Server on IP Address (10061) 錯誤的解決方案MySqlServer
- ERROR 2002 (HY000): Can't connect server socket /var/run/mysqld/mysqld.sockErrorServerMySql
- MySQL 5.5 原始碼安裝報錯"[ERROR] Can't start server"MySql原始碼ErrorServer
- Can't connect to X11 window server using DISPLAY variableServer
- NavicatPremium 連線SQL Server 、MySQL等REMServerMySql
- telnet連線socket serverServer
- navicat無法連線遠端的mysql--Host ‘xx.xx.xx.xx‘ is not allowed to connect to this MySQL server“MySqlServer
- Can't connect to X11 window server using '127.0.0.1:0.0'Server127.0.0.1