数据库配置远程连接
链接上数据库:
my2020@ubuntu:~$ mysql -h 127.0.0.1 -P3306 -uroot -p123456
选择数据库:
use mysql;
show tables; 查看Mysql里面是否包含user 表
选择查看 host , user 字段的信息:
Select host,user from user;
修改rootd访问权限:
Update user set host = ‘%’ where user=’root’;
查看user表的plugin 字段的root 密码属性:
Select host,user,plugin,authentication_string from user;
如图所示需要对密码进行修改:(r如果需要需改)
开放root权限命令:
Grant all privileges on . to ‘root’@‘%’ with grant option;
使各种权限设置立即生效