2
1

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 3 years have passed since last update.

MySQL8 特定のDBのフルアクセスを許可するユーザーを作成する

Posted at

概要

  • MySQLにて特定のDBのフルアクセスを許可するユーザーを作成する方法をまとめる。

前提

方法

  1. 下記コマンドを実行してrootユーザーでMySQLにログインする。

    $ mysql -u root -p
    
  2. 下記SQL句を実行してユーザーを作成する。

    create user 追加するユーザー名@localhost identified by '追加するユーザーがログイン時に使用するパスワード';
    
  3. 下記SQL句を実行してユーザーの権限を設定する。

    grant all privileges on データベース名.* to 先程追加したユーザー名@localhost;
    
  4. 下記SQL句を実行して今与えたユーザーの権限が正しい事を確認する。

    show grants for 先程追加したユーザー名@localhost;
    
2
1
1

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?