首先登录进MySQL1
mysql -u root -p
接着选择mysql
数据库1
use mysql;
然后使用如下命令开启root
用户远程访问权限1
2
3CREATE USER 'root'@'%' IDENTIFIED BY '你MySQL的root密码';
GRANT ALL ON *.* TO 'root'@'%';
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '你MySQL的root密码';
最后刷新一下权限1
FLUSH PRIVILEGES;