//mysql8.0版本之前的使用这个命令实现远程登录:
GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘%‘ IDENTIFIED BY ‘*********‘ WITH GRANT OPTION;
FLUSH PRIVILEGES;
//mysql 8.0版本以后需要使用这个命令实现远程登录
查看表中的数据:
SELECT User, mysql_native_password,Host FROM user;
修改远程登录的加密规则和用户密码:
ALTER USER ‘root‘@‘localhost‘ IDENTIFIED WITH mysql_native_password BY ‘********‘
ALTER USER ‘root‘@‘localhost‘ IDENTIFIED BY ‘********‘ PASSWORD EXPIRE NEVER;
FLUSH PRIVILEGES;