mysql 重置密码

mysql 重置密码,跳过登录修改密码:

# centos 7 上mysql 已经改名了,启动服务的时候注意是mariadb 了!!!!!

# 1
systemctl stop mariadb

# 2
systemctl set-environment MYSQLD_OPTS="--skip-grant-tables"

# 3
systemctl start mysqld

# 4 直接登录,无密码
mysql -u root

# 5
update user set password=password("new_password") where user='root';

# 6 
FLUSH PRIVILEGES;

# 7
quit

#8
systemctl stop mariadb

#9
systemctl unset-environment MYSQLD_OPTS

#10
systemctl start mysqld

#11
 mysql -u root -p

 

转载于:https://www.cnblogs.com/Anec/p/10531282.html

表情包
插入表情
评论将由博主筛选后显示,对所有人可见 | 还能输入1000个字符
相关推荐
©️2020 CSDN 皮肤主题: 编程工作室 设计师:CSDN官方博客 返回首页