《MysqL必读MysqL5.7忘记root密码及MysqL5.7修改root密码的方法》要点:
本文介绍了MysqL必读MysqL5.7忘记root密码及MysqL5.7修改root密码的方法,希望对您有用。如果有疑问,可以联系我们。
MysqL stop
MysqLd_safe --skip-grant-tables &
为了安全可以这样禁止远程连接:
MysqLd_safe --skip-grant-tables --skip-networking &
使用MysqL连接server:
MysqL -p
更改密码:
MysqL> update MysqL.user set authentication_string=password('123qwe') where user='root' and Host = 'localhost';
*特别提醒注意的一点是,新版的MysqL数据库下的user表中已经没有Password字段了
用户密码存储于authentication_string字段
MysqL> flush privileges;
MysqL> quit;
修改完毕.重启
MysqL restart
MysqL就可以连接了
功能不完全,还要alter user…
MysqL> alter user 'root'@'localhost' identified by '123';
MysqL> set password for 'root'@'localhost'=password('123');
重点给大家介绍下MysqL 5.7 root密码修改
随机密码,文件名.MysqL_secret.
MysqL_secret
# Password set for user 'root@localhost' at 2015-03-27 23:12:10
:Jj+FTiqvyrF
[root@bright ~]# cd /usr/local/MysqL/bin/
[root@bright bin]# ./MysqLadmin -u root -h localhost password '123456' -p
MysqL_secret里第二行内容
MysqLadmin: [Warning] Using a password on the command line interface can be insecure.
Warning: Since password will be sent to server in plain text,use ssl connection to ensure password safety.
MysqL都测试失败,亲们可以测试:
MysqL -uroot -p'password' #password即.MysqL_secret里的密码
MysqL>SET PASSWORD = PASSWORD('newpasswd');
MysqLd stop #停止MysqL服务
shell>MysqLd_safe --skip-grant-tables & #以不启用grant-tables模式启动MysqL
shell>MysqL -uroot -p #输入命令回车进入,出现输入密码提示直接回车.
MysqL>use MysqL;
MysqL>update user set password=PASSWORD("123456")where user="root"; #更改密码为 newpassord
MysqL>flush privileges; #更新权限
MysqL>quit #退出
MysqLd stop #停止MysqL服务
shell>MysqLd_safe --skip-grant-tables & #以不启用grant-tables模式启动MysqL
shell>MysqL -uroot -p #输入命令回车进入,出现输入密码提示直接回车.
MysqL > set password for root@localhost = password('MysqLroot');
MysqLadmin -u UserName -h Host password 'new_password' -p
编程之家PHP培训学院每天发布《MysqL必读MysqL5.7忘记root密码及MysqL5.7修改root密码的方法》等实战技能,PHP、MysqL、LINUX、APP、JS,CSS全面培养人才。
总结
如果觉得编程之家网站内容还不错,欢迎将编程之家网站推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您喜欢交流学习经验,点击链接加入交流1群:1065694478(已满)交流2群:163560250