0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

mysqlで特定のユーザのパスワード変更

Posted at
  • 下記コマンドを実行して、rootユーザーのパスワードを変更しようとしたら、
    「権限がない」ってエラーになった
ALTER USER 'root'@'localhost' IDENTIFIED BY 'xxxxxxx';
ERROR 1227 (42000): Access denied; you need (at least one of) the SYSTEM_USER privilege(s) for this operation
  • 現在ログインしているユーザにSYSTEM_USER権限を付与した
SELECT Host, User FROM mysql.user;
+-----------+------------------+
| Host      | User             |
+-----------+------------------+
| %         | admin            |
| %         | root             |
| localhost | mysql.infoschema |
| localhost | mysql.session    |
| localhost | mysql.sys        |
| localhost | root             |
+-----------+------------------+

GRANT SYSTEM_USER ON *.* TO 'admin'@'%';
Query OK, 0 rows affected (0.01 sec)
  • 再度rootユーザーのパスワードを変更を実行 → 成功
ALTER USER 'root'@'localhost' IDENTIFIED BY 'xxxxxxx';
Query OK, 0 rows affected (0.01 sec)
0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?