ubuntu中mysql8.0+版本远程连接的问题
在自己的笔记本上安装了windows好linux双系统,安装了mysql8.0版本后发现无法进行远程连接。解决后进行了以下总结:
1.bind-address没有注释
MySQL的配置文件/etc/mysql/mysql.conf.d/mysqld.cnf中
需要把bind-address之一行注释
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address = 127.0.0.1
#
2.修改root的权限
use mysql;
select user,host from user;//查看用户和全程连接权限
update user set host='%' where user=’root';//修改连接权限
grant all privileges on *.* to 'root'@'%' with grant option;//赋权限
flush privileges;