LoginSignup
0
0

More than 3 years have passed since last update.

mysqlで新規ユーザーを作成する方法

Posted at

1 まずはデフォルトユーザーであるrootでmysqlにログインする

mysql -u root

2 ログインできたら、mysqlのユーザ一覧でどんなユーザーがいるのか確認する

SELECT Host, User FROM mysql.user;

3 新しくユーザー作成する

grant all on データベース名.* to ユーザー名@接続元 identified by ‘パスワード’;

4 現在rootでログインしてるためexitでログアウトする

5 新規で作成したユーザーでログインする

mysql -u ユーザー名 -p

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