14
12

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

MySQL8.0ではGRANTでユーザ登録ができなかった話

Last updated at Posted at 2019-06-19

#MySQL8.0でユーザを登録する

いつもの様に・・・
ホレ! :older_man_tone3:

mysql> GRANT all ON *.* TO 'devusr'@'%' IDENTIFIED BY 'MyNewPass4!';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IDENTIFIED BY 'MyNewPass4!'' at line 1

ん?
あ、え・・・:sweat_smile:

:point_down_tone2:こんな感じでイケました

mysql> create user 'devusr'@'%' identified by 'MyNewPass4!';
Query OK, 0 rows affected (0.01 sec)
mysql> grant all on *.* to 'devusr'@'%';
Query OK, 0 rows affected (0.00 sec)

あざます :pray_tone2:

#★追記
Laravelのmigrateで以下のエラー

SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client ...

を出さないためには

こんな感じにするらしい。旧認証方式で暗号化。

mysql> create user 'devusr'@'%' identified WITH mysql_native_password by 'MyNewPass4!';
Query OK, 0 rows affected (0.01 sec)
14
12
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
14
12

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?