ERROR 2003 (HY000)Can't connect to MySQL server on '192.168.8.247' (113)
[root@ora102 ~]# mysql -uroot -pchinabidding -h192.168.8.247
Warning: Using a password on the command line interface can be insecure.
排查問題:
1)網路是通的
ERROR 2003 (HY000): Can't connect to MySQL server on '192.168.8.247' (113)
[root@ora102 ~]# ping 192.168.8.247
PING 192.168.8.247 (192.168.8.247) 56(84) bytes of data.
64 bytes from 192.168.8.247: icmp_seq=1 ttl=64 time=0.510 ms
64 bytes from 192.168.8.247: icmp_seq=2 ttl=64 time=0.446 ms
64 bytes from 192.168.8.247: icmp_seq=3 ttl=64 time=0.475 ms
2)許可權是沒問題的
MySQL [(none)]> select host,user,password from mysql.user;
+-----------+------+-------------------------------------------+
| host | user | password |
+-----------+------+-------------------------------------------+
| localhost | root | *2548EFB13B516547C44482A519B886726A3B8E42 |
|%| root | *2548EFB13B516547C44482A519B886726A3B8E42 |
| 127.0.0.1 | root | *2548EFB13B516547C44482A519B886726A3B8E42 |
| ::1 | root | *2548EFB13B516547C44482A519B886726A3B8E42 |
3)vi /etc/my.cnfi 檢視引數bind-address 是否設定成了 = 127.0.0.1
我壓根沒有設定這個引數,這個引數是預設是127.0.0.1,限制只能本地登入。
4)檢視防火牆狀態,如下,active的,防火牆的是開的。
bogon:root@~>service iptables status
Redirecting to /bin/systemctl status iptables.service
● iptables.service - IPv4 firewall with iptables
Loaded: loaded (/usr/lib/systemd/system/iptables.service; disabled; vendor preset: disabled)
Active: active (exited)since Wed 2017-12-06 15:01:37 CST; 2s ago
Process: 21617 ExecStop=/usr/libexec/iptables/iptables.init stop (code=exited, status=0/SUCCESS)
Process: 22369 ExecStart=/usr/libexec/iptables/iptables.init start (code=exited, status=0/SUCCESS)
Main PID: 22369 (code=exited, status=0/SUCCESS)
Dec 06 15:01:37 bogon systemd[1]: Starting IPv4 firewall with iptables...
Dec 06 15:01:37 bogon iptables.init[22369]: iptables: Applying firewall rules: [ OK ]
Dec 06 15:01:37 bogon systemd[1]: Started IPv4 firewall with iptables.
檢視埠,然後嘗試去遠端telnet 這個埠是否是同的。
MySQL [(none)]> show global variables like 'port';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| port | 3306 |
+---------------+-------+
1 row in set (0.00 sec)
telne果然是不通的
[root@ora102 ~]# telnet 192.168.8.247 3306
Trying 192.168.8.247...
telnet: connect to address 192.168.8.247: No route to host
在源段關閉防火牆:
bogon:root@~>service iptables stop
Redirecting to /bin/systemctl stop iptables.service
永久關閉:
bogon:root@~>chkconfig iptables on
再次在遠端登陸,正常了。。。。
[root@ora102 ~]# mysql -uroot -pchinabidding -h192.168.8.247
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 21
Server version: 5.5.29-log Source distribution
Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
至此問題解決。。。。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29654823/viewspace-2148357/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- MySQL 2003 - Can’t connect to MySQL server on (10060)MySqlServer
- linux下連線mysql報錯ERROR 2002 (HY000): Can‘t connect to local MySQL server through socket ‘/var/lib/mysqLinuxMySqlErrorServer
- Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock錯誤MySqlServer
- Mysql連線錯誤ERROR 2003 (HY000)MySqlError
- Error:Can't connect to SOCKS proxy:Connection refused (Connection refused)Error
- Can't Connect to MySQL Server on IP Address (10061) 錯誤的解決方案MySqlServer
- ERROR 1290 (HY000): The MySQL server is running withErrorMySqlServer
- mysql 啟動報錯Can't connect to local MySQL server through socket '/data/mysql/mysql/mysql.sock'(111)MySqlServer
- Navicat 連線 MySQL 失敗:2002-can‘t connect to server on localhost(10061)問題解決MySqlServerlocalhost
- ERROR 2013 (HY000): Lost connection to MySQL server at 'reading authorization paErrorMySqlServer
- MySQL報錯ERROR 2013 (HY000): Lost connection to MySQL server during queryMySqlErrorServer
- ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables optErrorMySqlServer
- psql: error: could not connect to server: No such file or directorySQLErrorServer
- MySQL報錯Table 'plugin' is read only [ERROR] Can't open the mysql.plugin table.MySqlPluginError
- Linux:ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannLinuxErrorMySqlServer
- Host 'localhost' is not allowed to connect to this MySQL serverlocalhostMySqlServer
- “Host ‘xxxx‘ is not allowed to connect to this MySQL server“MySqlServer
- MySQL-1130-host ... is not allowed to connect to this MySql serverMySqlServer
- [mac pip錯誤]Can't connect to HTTPS URL because the SSL module is not availableMacHTTPAI
- [ERROR] mysqld: Can‘t open shared library ‘/usr/local/mysql/lib/plugin/validate_password.so‘ (errno:ErrorMySqlPlugin
- Host 'xxx' is not allowed to connect to this MySQL server.MySqlServer
- Fatal error: can't check configuration file '/home/watt/proxy/dError
- 解決ERROR 1231 (42000): Variable 'time_zone' can'tError
- ERROR 1840 (HY000) at line 24: @@GLOBAL.GTID_PURGED can only be set when @@GLOBAError
- mysql遇到Variable can’t be set to the value of ‘NULL’MySqlNull
- 【MySQL】ERROR 1878 (HY000): Temporary file write failure.MySqlErrorAI
- GTID複製報錯處理:Last_Error: Error 'Can't drop database 'test';ASTErrorDatabase
- 完美解決stack Error: Can‘t find Python executable “python“, you can set the PYTHON env variable.ErrorPython
- 上手MySQL之解決問題:not allowed to connect to this MySQL serverMySqlServer
- Host 'xxx' is not allowed to connect to this MySQL server 解決方法MySqlServer
- ERROR 2026 (HY000): SSL connection error: unknown error numberError
- Mysql:Variable 'XXXt' can't be set to the value of 'NULL'解決MySqlNull
- 阿里雲mysql遠端登入報ERROR 2027(HY000)阿里MySqlError
- MySQL 報錯 ERROR 1290 (HY000): running with the --secure-file-privMySqlError
- MYSQL報1022錯誤:Can't write;duplicate key in table '.....'MySql
- mysql中You can’t specify target table for update in FROM clMySql
- ERROR 1114 (HY000) The table '' is fullError
- Navicat連線centos裡mysql報錯Host is not allowed to connect to this MySQL serverCentOSMySqlServer
- 【MySQL】ERROR 1290 (HY000): --secure-file-priv--匯出報錯MySqlError