首页 > 数据库技术 > 详细

重置mysql密码

时间:2016-05-18 22:07:11      阅读:149      评论:0      收藏:0      [点我收藏+]

重置mysql密码:

mysqladmin -uroot password ‘123‘ 增加用户

在配置文件增加:vim /etc/my.cnf

skip-grant

重启mysql:/etc/init.d/mysqld restart

use mysql

update user set password=password(‘新密码‘) where user=‘root‘

select * from user where user=‘root‘\G;



创建用户和密码

mysql -uroot -e "grant all on *.* to ‘zabbix‘@‘localhost‘ identified by ‘zabbix‘"; 


重置mysql密码

原文:http://mengbo2006214.blog.51cto.com/6687714/1774828

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!