开放数据库访问权限
修改root的访问权限
首先开放root任意ip地址可访问
mysql>update user set host = '%' where user = 'root';
修改后查看是否修改成功
mysql>select host, user from user;
mysql8 :客户端连接caching-sha2-password问题
#修改加密规则
ALTER USER 'root'@'localhost' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER;
#更新一下用户的密码
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
#刷新权限
FLUSH PRIVILEGES;