LoginSignup
1
0

More than 1 year has passed since last update.

MySQLの読み取り専用ユーザーの作成方法

Last updated at Posted at 2022-07-11

これは何(what)

業務で稀に読み取り権限しか持たないMySQLユーザーを作成したいケースがあるんですが、
毎回調べてて時間がもったいないと思ったので備忘録として書く

作り方(how to)

-- ユーザー一覧
select Host, User, Plugin from mysql.user;

-- 読み取りユーザー作成
GRANT SELECT ON development.* to 'read_only_user'@'%' IDENTIFIED BY 'newpassword';

-- 権限確認
SHOW GRANTS FOR 'read_only_user'@'%';

-- ユーザー削除
DROP USER 'read_only_user'@'%'

参考(reference)

1
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
1
0