尝试打开授权

mysql> grant all privileges on *.* to root@'%' identified by "oracle";
ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot

报错,需要注销参数--skip-grant-tables

execute this statement
mysql> exit
Bye
[root@oracle01 tmp]# vi /etc/my.cnf
[client]
socket = /kingsql/database/mysql/tmp/mysql.sock

[mysqld_safe]
log-error=/kingsql/database/mysql/log/mysqld.log
pid-file=/kingsql/database/mysql/mysqld.pid

[mysqld]
basedir = /kingsql/database/mysql
datadir = /kingsql/database/mysql/data
port = 3306
socket = /kingsql/database/mysql/tmp/mysql.sock
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
#skip-grant-tables
~
~
~
"/etc/my.cnf" 14L, 379C written

注销之后重启mysql

[root@oracle01 tmp]# mysqladmin shutdown
[root@oracle01 tmp]# mysqld_safe &
[1] 15994
[root@oracle01 tmp]# 2018-06-22T03:30:46.306881Z mysqld_safe Logging to '/kingsql/database/mysql/log/mysqld.log'.
2018-06-22T03:30:46.364335Z mysqld_safe Starting mysqld daemon with databases from /kingsql/database/mysql/data

客户端还是无法连接,报错10060

经过检查关闭windows防火墙

客户端还是无法连接,报错10060

经过检查关闭linux防火墙

[root@oracle01 tmp]# service iptables status
Table: filter
Chain INPUT (policy ACCEPT)
num target prot opt source destination
1 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
2 ACCEPT icmp -- 0.0.0.0/0 0.0.0.0/0
3 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
4 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:22
5 REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited

Chain FORWARD (policy ACCEPT)
num target prot opt source destination
1 REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited

Chain OUTPUT (policy ACCEPT)
num target prot opt source destination

[root@oracle01 tmp]# service iptables stop
iptables: Setting chains to policy ACCEPT: filter [ OK ]
iptables: Flushing firewall rules: [ OK ]
iptables: Unloading modules: [ OK ]

最后连接成功