本文介绍了Centos7 修改MysqL指定用户的密码,具体如下:
1.登陆MysqL或者mariadb(两种任选其一)
[root@localhost ~]MysqL -u root
[root@localhost ~]MysqL -uroot -p
MariaDB [MysqL]> MysqL显示以下内容
Reading table information completion of table and column names You can turn off this feature to get a quicker startup with -
3.修改密码,适用password()函数进行加密,实际上就是执行sql语句来更新指定用户的密码
MariaDB [MysqL]> update user set password=password('新密码') where user='要更新密码的用户名'->,0 rows affected (0.00: 5 Changed: 0 Warnings: 0
4.刷新用户权限列表
MariaDB [MysqL]> ,0 rows affected (0.00 sec)
MariaDB [MysqL]>
6.重启MysqL或者mariadb服务
[root@localhost ~]MysqLd restart(重启MysqL)
[root@localhost ~]
原文链接:https://www.f2er.com/linux/403234.html