1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| # 9.登录mysql # 方式1 mysql -u root -p # 修改密码 ALTER USER 'root'@'localhost' IDENTIFIED BY 'newPassword'; ALTER USER 'root'@'localhost' IDENTIFIED BY 'Ideal@147258'; use mysql; update user set host = '%' where user = 'root'; FLUSH PRIVILEGES;
# 方式2 mysql -uroot -p use mysql; # Mysql默认不允许远程登录,所以需要开启远程访问权限 select user,authentication_string,host from user; update user set host = '%' where user = 'root'; FLUSH PRIVILEGES; # navicat 连接 mysql 出现`Client does not support authentication protocol requested by server` alter user 'root'@'%' identified with mysql_native_password by '密码';
|