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?

More than 1 year has passed since last update.

【ほぼ自分用】よく使用したMySQLコマンド

Posted at

ここでは、

ユーザー名: user_name
パスワード: user_pass
DB名 : test_db

として例を記載します。

現在接続しているユーザーを確認

select user(), current_user();

ユーザー一覧とホスト名の取得

select user, host, password from mysql.user;

all 権限の付与

grant all on test_db.* to 'user_name'@'%' identified by 'user_pass';

設定されている権限の確認

show grants for 'user_name'@'%';

ユーザー作成

CREATE USER user_name IDENTIFIED BY 'user_pass';
または
CREATE USER 'user_name'@'localhost' IDENTIFIED BY 'user_pass';

強化版

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?