よく忘れてしまうので、mysqlのuser系のコマンドのまとめ
-
ユーザー作成
-
create user 'username'@'host'
-
ユーザー変更
-
rename user old to new
-
ユーザー一覧
-
select Host,User from mysql.user;
-
権限確認
-
show grants for 'user'@'localhost'; // pw なし
-
grant all privileges on database.* to 'root'@'localhost' identified by 'password';
-
with grant optionつけると管理者権限
-
権限付与
-
GRANT 権限 ON db_name.* TO user;
-
※ 権限=ALL/select/create/update等
-
権限削除
-
revoke all on isucon.* from 'root'@'localhost';