-
mysql5.7默认无密码登录默认root用户无密码登录
-
数据库
mysql中的user表的plugin字段为auth_socket# 查看所有的数据库 show databases; # 使用名为 mysql 的数据库 use mysql; # 查看 Host,User,plugin,authentication_string # authentication_string 对应加密之后的密码 select Host,User,plugin,authentication_string from user;
查看 plugin
-
修改密码
-
update user set authentication_string=PASSWORD('password'),plugin='mysql_native_password' where User='root' and Host='localhost';- 设置本机的
root用户的密码为password以及使用密码登录
- 设置本机的
设置密码以及密码登录
-
-
刷新
FLUSH PRIVILEGES;
刷新
-
重新登录
重新登录







网友评论