マイグレーション実行時にこんなエラーが出ます。。。
usernoMacBook
1 2 Illuminate\Database\QueryException : SQLSTATE[HY000] [1045] Access denied for user 'homestead'@'172.22.0.1' (using password: YES) (SQL: select * from information_schema.tables where table_schema = homestead and table_name = migrations) 3 4 at /Users/user/Desktop/laravel0619/CRUDproject/vendor/laravel/framework/src/Illuminate/Database/Connection.php:664 5 660| // If an exception occurs when attempting to run a query, we'll format the error 6 661| // message to include the bindings with SQL, which will make this exception a 7 662| // lot more helpful to the developer instead of just the database's errors. 8 663| catch (Exception $e) { 9 > 664| throw new QueryException( 10 665| $query, $this->prepareBindings($bindings), $e 11 666| ); 12 667| } 13 668| 14 15 Exception trace: 16 17 1 PDOException::("SQLSTATE[HY000] [1045] Access denied for user 'homestead'@'172.22.0.1' (using password: YES)") 18 /Users/user/Desktop/laravel0619/CRUDproject/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:68 19 20 2 PDO::__construct("mysql:host=127.0.0.1;port=3306;dbname=homestead", "homestead", "secret", []) 21 /Users/user/Desktop/laravel0619/CRUDproject/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:68
原因はMysql側の権限関係にあるのかな?と思い、権限付与をしようとするとこんなエラーが。。
mysql> grant all privileges on *.* to root@localhost identified by root with grant option; 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 root with grant option' at line 1
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。