duanquanhan2333 2019-05-03 00:07
浏览 108
已采纳

如何修复此错误[2045]或此[1054]当我尝试迁移表时,我总是在终端中收到此消息

when I type php artisan migrate in terminal

I get this error number [2054] and sometimes [1054] !

I tried to change everything like host, username and password in .env file

database.php and config.php file, but it didn't work well

Illuminate\Database\QueryException : SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO) (SQL: select * from information_schema.tables where table_schema = lsapp and table_name = migrations)

at /Users/Ali/education/vendor/laravel/framework/src/Illuminate/Database/Connection.php:664 660| // If an exception occurs when attempting to run a query, we'll format the error 661| // message to include the bindings with SQL, which will make this exception a 662| // lot more helpful to the developer instead of just the database's errors. 663| catch (Exception $e) { 664| throw new QueryException( 665| $query, $this->prepareBindings($bindings), $e 666| ); 667| } 668|

  • 写回答

2条回答 默认 最新

  • dtv11049 2019-05-04 15:39
    关注

    Finally, I got the solution by downloading MySQL Workbench then create a new database in this app , and it's working fine

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?