修改非root用户密码
修改非root用户密码
问题描述
MySQL Ver:5.7 无法使用password()函数
mysql> update user set authentication_string = password('SIZ_huilong_666') where user = 'study_in_zhengzhou';
Query OK, 0 rows affected, 1 warning (0.00 sec)
Rows matched: 1 Changed: 0 Warnings: 1
mysql> show warnings\G
*************************** 1. row ***************************
Level: Warning
Code: 1681
Message: 'PASSWORD' is deprecated and will be removed in a future release.
1 row in set (0.00 sec)
解决方案
使用root用户登录后
语法:use SET PASSWORD FOR <user> = '<plaintext_password>'
例子:use SET PASSWORD FOR user_test = '123456'