mysql修改密码

1)修改数据库密码

#/opt/lampp/bin/mysql -u root -pdfwx@2019

#use mysql
#grant all on *.* to 'root'@'%' IDENTIFIED BY 'test@2019' ; #标红位置为需要设置的密码
#flush privileges;

2)删除mysql数据库user表里面的密码记录条数(只保留上面最新加的一条),如下:

#use mysql

# select * from user;  

 

3)重启数据库

/opt/lampp/bin/mysql.server restart

posted @ 2020-01-17 17:17  syy714363310  阅读(143)  评论(0)    收藏  举报