阿里云服务器需要配置安全组 加入3306端口
whereis my.cnf //查找my.cnf文件
- vim /etc/my.cnf
注释这一行:bind-address=127.0.0.1 ==> #bind-address=127.0.0.1 //有就注释,没有不用管
保存退出。 - 登陆mysql:
mysql -uroot -p - 为需要远程登录的用户赋予权限:
mysql> GRANT ALL PRIVILEGES ON . TO root@"%" IDENTIFIED BY "password";
//password为数据库登录密码 - mysql> flush privileges; //刷新权限信息
- navicate 远程登录: (不需要SSH)