20
12

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

mysqlでrootのpasswordを変更しようとしてSyntaxエラー吐かれた

Posted at

password関数で変更しようとした

rootのpasswordを変更に関する多くの解説記事ではpassword関数で変更しようとしていますが、

mysql> update user set password=password('********') where user = 'root';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '('********') where user = 'root'' at line 1

password関数は廃止されていた

MySQL8でユーザーのパスワードの変更 / リセット方法
はい、ありがとうございます。
ver. 5.6.7時点でどうやら廃止されたようでした。

mysql> set password for 'root'@'localhost' = '********';
Query OK, 0 rows affected (0.02 sec)
20
12
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
20
12

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?