Mysql—修改用户密码(重置密码)
Mysql—修改⽤户密码(重置密码)1、登录mysql
1 2[root@localhost ~]# mysql -uroot -p123456
[root@localhost ~]# mysql -hlocalhost -uroot -p123456
如何创建apple id如果忘记密码,则跳过MySQL的密码认证过程。步骤如下:
修改Mysql配置⽂件:vi /etc/myf(注:windows下修改的是my.ini)。在[mysqld]后⾯任意⼀⾏添加“skip-grant-tables”⽤来跳过密码验证的过程。
重启Mysql:
进⼊Mysql:[root@localhost ~]# mysql -uroot -p
周公解梦梦见人死了2、使⽤mysql数据库,从user表中查看主机,⽤户名,密码
1 2 3 4 5 6 7 8-- 使⽤mysql数据库
mysql> use mysql;
-- 查询主机⽤户名密码:5.7版本之前的
mysql> select host,user,plugin,password from user;
-- 查询主机⽤户名密码:5.7版本之后的,包括5.7
mysql> select host,user,plugin,authentication_string from user; mysql> select host,user,plugin,authentication_string from user\G; mysql> select host,user,plugin,authentication_string from mysql.user;
3、修改密码,刷新⼀下权限
1 2 3mysql> update user set password=password("新密码") where user="root"; mysql> flush privileges;
人的气质类型mysql> quit
袁惟仁 老婆上⾯修改密码是在5.7版本之前的。若是5.7版本之后的(包括5.7),没有password这个字段了,则修改⽅法如下:
健康产业项目有哪些
1 2 3 4mysql> alter user"root"@"localhost"identified by"新密码";  --⽅法1
mysql> update user set authentication_string=password("新密码") where user="root";  -- ⽅法2 mysql> flush privileges;
mysql> quit
4、如果以上不能解决密码修改,则使⽤下⾯⽅法
1 2 3mysql> use mysql;
mysql> alter user"root"@"localhost"identified with mysql_native_password by"新密码"; mysql> flush privileges;
修改加密规则:mysql> alter user "root"@"localhost" identified by 'password' PASSWORD EXPIRE NEVER;
如果执⾏以上的操作并没有解决,请再把default_authentication_plugin=mysql_native_password添加到配置中。
5、再去编辑⼀下myf配置⽂件,去掉skip-grant-tables。
怎样注册商标6、重启Mysql,⽤你修改后的密码登录Mysql。

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。