vim/etc/my.cnf注释这一行:bind-address=127.0.0.1==>#bind-address=127.0.0.1保存退出。mysql-uroot-p123456为
vim /etc/my.cnf
注释这一行:bind-address=127.0.0.1 ==> #bind-address=127.0.0.1
保存退出。
mysql -uroot -p123456
为需要远程登录的用户赋予权限:
mysql> GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY "123456";
mysql> flush privileges;
远程登录命令:
mysql -h 223.4.92.130 -uroot -p(-h后跟的是要登录主机的ip地址)