異常:Can't connect to MySQL server (10060)
當遠端連線MySQL資料庫的時候顯示Can't connect to MySQL server (10060),我們從以下幾個方面入手,找出錯誤的原因:
1.網路不通。
檢查能不能ping通。
2.防火牆設定。
防火牆是否放過mysql的程式,是否遮蔽了mysql的3306埠。
3.mysql的賬戶設定。
mysql賬戶是否不允許遠端連線。如果無法連線可以嘗試以下方法:
- mysql -u root -p //登入MySQL
- mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'WITH GRANT OPTION; //任何遠端主機都可以訪問資料庫
- mysql> FLUSH PRIVILEGES; //需要輸入次命令使修改生效
- mysql> EXIT //退出
也可以通過修改表來實現遠端:
- mysql -u root -p
- mysql> use mysql;
- mysql> update user set host = '%' where user = 'root';
- mysql> select host, user from user;
其實錯誤的原因也不外乎以上幾個方面,相信按照上面的思路找出原因,定能將問題解決掉
原文地址:點選開啟連結
相關文章
- 連線MySQL錯誤:Can't connect to MySQL server (10060)MySqlServer
- MySQL 2003 - Can’t connect to MySQL server on (10060)MySqlServer
- 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 '/tmp/mysql.sock '(2) "MySqlServer
- [jenkins]Can’t connect to window server – not enough permissionsJenkinsServer
- Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock錯誤MySqlServer
- Can't connect to X11 window server usingServer
- mysqldump: Got error: 2002: Can't connect to local MySQL server through.....MySqlGoErrorServer
- MySQL 5.5 關閉資料庫報錯"Can't connect to local MySQL server through socket"MySql資料庫Server
- MySQL問題記錄--Can't connect to MySQL server on localhost (10061)解決方法MySqlServerlocalhost
- MySQL報錯'ERROR 2002 (HY000): Can't connect to local MySQL server through'MySqlErrorServer
- 【linux】Can't connect to MySQL server on 'XXX' (13)問題解決方式LinuxMySqlServer
- mysql can't connect error about privilege----not root userMySqlError
- Can't connect to X11 window server using DISPLAY variableServer
- mysql 啟動報錯Can't connect to local MySQL server through socket '/data/mysql/mysql/mysql.sock'(111)MySqlServer
- 異常: 'ascii' codec can't encode charactersASCII
- ERROR 2002 (HY000): Can't connect server socket /tmp/mysql.sockErrorServerMySql
- Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)解決方法MySqlServer
- Can't connect to X11 window server using '127.0.0.1:0.0'Server127.0.0.1
- 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
- Can't Connect to MySQL Server on IP Address (10061) 錯誤的解決方案MySqlServer
- MySQL不能啟動 Can't start server : Bind on unix sockeMySqlServer
- Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable.Server
- java.lang.InternalError: Can't connect to X11 window server using ':0.0' asJavaErrorServer
- MySQL遠端連線ERROR 2003 (HY000) Cant connect to MySQL server on (10060)MySqlErrorServer
- MySQL 5.5 原始碼安裝報錯"[ERROR] Can't start server"MySql原始碼ErrorServer
- ERROR 2002(HY000):Can't connect to local MySQL socket '/tmp/mysql.sock'ErrorMySql
- Navicat 連線 MySQL 失敗:2002-can‘t connect to server on localhost(10061)問題解決MySqlServerlocalhost
- 使用雲伺服器配置MariaDB環境,Navicat遠端連線一直出錯誤程式碼 "2002 - Can't connect to server on '' (10060)"伺服器Server
- easy_install 異常(zipimport.ZipImportError: can’t decompress data; zlib notImportError
- ERROR 2002 (HY000): Can't connect server socket /var/run/mysqld/mysqld.sockErrorServerMySql
- linux下連線mysql報錯ERROR 2002 (HY000): Can‘t connect to local MySQL server through socket ‘/var/lib/mysqLinuxMySqlErrorServer
- Error:Can't connect to SOCKS proxy:Connection refused (Connection refused)Error
- MySQL案例-不同尋常的[ERROR]Can't create a new thread (errno 11)MySqlErrorthread
- [ERROR] Can't open the mysql.plugin tableErrorMySqlPlugin
- mysql遇到Variable can’t be set to the value of ‘NULL’MySqlNull