主机配置/etc/hosts,通过ip可解析道hostname
[root@host-172-28-0-3 my.cnf.d]# mysql -uroot -p123456 -h172.28.0.3
ERROR 1045 (28000): Access denied for user 'root'@'host-172-28-0-3' (using password: YES)
上述错误可以看到,使用ip登陆时被解析成了域名然后提示不允许等了。
在mac上的使用mysqlworkbench可登录。
修改my.cnf关闭mysql的域名解析:
[root@host-172-28-0-3 my.cnf.d]# vi /etc/my.cnf
my.cnf my.cnf.d/
[root@host-172-28-0-3 my.cnf.d]# vi /etc/my.cnf
[root@host-172-28-0-3 my.cnf.d]# vi /etc/my.cnf.d/openstack.cnf
[root@host-172-28-0-3 my.cnf.d]# systemctl restart mariadb
[root@host-172-28-0-3 my.cnf.d]# mysql -uroot -p123456 -h172.28.0.3
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 2
Server version: 10.1.12-MariaDB MariaDB Server
Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> ^DBye
[root@host-172-28-0-3 my.cnf.d]#
可登录。
仅仅做记录。