环境:ubuntu16.04 LTS
在ubuntu中安装好mysql后,需要做以下配置才可以远程连接上
mysql配置里面:#bind-address = 127.0.0.1这句注释掉,或者改成mysql数据库服务端的ip地址
grant all privileges on mytest.* to ‘root’@‘需要连接该数据库的电脑的外网ip地址’ identified by ‘mysql的登陆密码’ with grant option;
或者
grant all on mytest.* to ‘root’@’%’ identified by ‘mysql的登陆密码’ ;
即privileges单词可以省略, with grant option也可以省略 , ‘root’@’%’ 代表所有ip都可以以root账户登录
如果出现报错:ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
说明你的密码强度不够,在mysql中执行下面两句:
set global validate_password_policy=0;
set global validate_password_length=4;
最后:flush privileges; 就可以了
11万+

被折叠的 条评论
为什么被折叠?



