mysql5.6之前修改密码(字段password)
mysql> use mysql;
mysql> update user set password=password(‘123‘) where user=‘root‘ and host=‘localhost‘;
mysql> flush privileges;
mysql 5.7.22版本修改密码(字段是authentication_string)
mysql> use mysql;
mysql>update user authentication_string=password(‘root123‘) where user=‘root‘
mysql> flush privileges;
使用mysqladmin工具
格式:mysqladmin -u用户名 -p旧密码 password 新密码
[cqs@centos7 ~]$ mysqladmin -uroot -proot password ‘root123‘
mysql5.7.22版本修改root密码
标签:字段 update oca 修改root密码 str localhost and local mysql
本条技术文章来源于互联网,如果无意侵犯您的权益请点击此处反馈版权投诉
本文系统来源:https://blog.51cto.com/1929297/2419547