Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationEventAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
8
Help us understand the problem. What are the problem?

More than 1 year has passed since last update.

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

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)
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
8
Help us understand the problem. What are the problem?