なかなか Laravelで MySQLに接続できない

つい最近の投稿がありました まさしくここに僕がこの一日間悩みぬいた問題の解決策がありました こんなことどこにも書いていません

$mysql -u root -p****

#これで mysql consoleに入れますので promptが変わります

mysql> select host, user from mysql.user;
+-----------+---------------+
| host      | user          |
+-----------+---------------+
| 127.0.0.1 | root          |
| ::1       | root          |
| localhost | laraveluser   |
| localhost | mamp          |
| localhost | mysql.session |
| localhost | mysql.sys     |
| localhost | root          |
+-----------+---------------+
7 rows in set (0.00 sec)

mysql> create user 'laraveluser'@'localhost' identified by 'laravelpassword';
Query OK, 0 rows affected (0.00 sec)

mysql> grant all privileges on laravel.* to 'laraveluser'@'localhost';
Query OK, 0 rows affected (0.00 sec)

mysql> alter user 'laraveluser'@'localhost' identified with mysql_native_password by 'laravelpassword';
Query OK, 0 rows affected (0.00 sec)

mysql> SELECT user, host, plugin FROM mysql.user;
+---------------+-----------+-----------------------+
| user          | host      | plugin                |
+---------------+-----------+-----------------------+
| root          | localhost | mysql_native_password |
| mysql.session | localhost | mysql_native_password |
| mysql.sys     | localhost | mysql_native_password |
| mamp          | localhost | mysql_native_password |
| root          | 127.0.0.1 | mysql_native_password |
| root          | ::1       | mysql_native_password |
| laraveluser   | localhost | mysql_native_password |
+---------------+-----------+-----------------------+
7 rows in set (0.00 sec)

さてここまでやっとたどり着きました

投稿者: (KAMAKURA & SAPPORO)Dr_Radialist

Expert Interventional Cardiologist and Amateur Computer Programmer. Winner for Master Clinical Operator Award in TCT 2019. Winner for Ethica Award in EuroPCR 2015.

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です