18
18

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ユーザーにすべてのホストからすべてのデータベースにすべての権限を与えるコマンド

Posted at

環境
MySQL-Server: 5.5.43
User: root
Pass: なし

恐ろしいコマンド

example
mysql> grant all privileges on *.* to root@"%";

せいっ
開発環境なんかでは、細かく設定するのがめんどくさくていつもこれ打っちゃう。
パスワードを設定している場合は

example
mysql> grant all privileges on *.* to root@"%" identified by 'ぱすわーど';

設定反映させて終了

example
mysql> flush privileges;
18
18
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
18
18

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?