win10内嵌ubuntu中mysql配置总结

1.不需每次执行加sudo

update mysql.user set authentication_string=PASSWORD('mysql'), plugin='mysql_native_password' where user='root';

flush privileges;

2.允许远程链接

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'yourspassword' WITH GRANT OPTION;

FLUSH PRIVILEGES;

3.修改mysql配置文件允许远程

输入命令vi /etc/mysql/my.cnf 

找到 bind-address= 127.0.0.1这一行,然后将其注释掉。因为这一行的意思是只能localhost可以连接

然后保存退出。重启mysql服务。

原文地址:https://www.cnblogs.com/happen-/p/10239099.html