Ubuntu下开启MySQL远程连接权限
一、将用户的访问地址改为%
- 打开终端登录mysql数据库:
mysql -u root -p
- 查看user表
mysql>use mysql;
Database changeed
mysql>select host, user, authentication_string from user;
注意此处网上很多教程写的是password,那是老版的了,现在的MySQL的mysql数据库的user表中已经没有password字段了,而是换成了
authentication_string
±----------±-----------------±------------------------------------------+
| host | user | authentication_string |
±----------±-----------------±------------------------------------------+
| localhost | root | ********************************** |
| localhost | mysql.session | ********************************** |
| localhost | mysql.sys | ********************************** |
| localhost | debian-sys-maint | ***