[英]How to fix this error[2045] or this [1054] I always get this message in terminal when i try to migrate table
when I type php artisan migrate
in terminal 当我在终端输入
php artisan migrate
时
I get this error number [2054]
and sometimes [1054]
! 我得到这个错误号
[2054]
,有时[1054]
!
I tried to change everything like host
, username
and password
in .env
file 我试图在
.env
文件中更改host
, username
和password
等所有内容
database.php
and config.php
file, but it didn't work well database.php
和config.php
文件,但是效果不好
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)
Illuminate \\ Database \\ QueryException:SQLSTATE [HY000] [1045]拒绝访问用户'root'@'localhost'(使用密码:NO)(SQL:select * from information_schema.tables where table_schema = lsapp和table_name = migrations)
at /Users/Ali/education/vendor/laravel/framework/src/Illuminate/Database/Connection.php:664 660|
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|
//如果在尝试运行查询时发生异常,我们将格式化错误661 | // message to include the bindings with SQL, which will make this exception a 662|
//包含SQL绑定的消息,这将使此异常成为662 | // lot more helpful to the developer instead of just the database's errors.
//对开发人员更有帮助,而不仅仅是数据库的错误。 663|
663 | catch (Exception $e) { 664|
catch(Exception $ e){664 | throw new QueryException( 665| $query, $this->prepareBindings($bindings), $e 666| );
抛出新的QueryException(665 | $ query,$ this-> prepareBindings($ bindings),$ e 666 |); 667|
667 | } 668|
} 668 |
The error says you do not have permission to do queries. 该错误表示您无权进行查询。 You need to access with the password and/or the database must have a password.
您需要使用密码访问和/或数据库必须有密码。
Verify the access codes (user, password) or try to access by a web manager, like phpmyadmin, pgadmin, etc ... 验证访问代码(用户,密码)或尝试访问Web管理器,如phpmyadmin,pgadmin等...
最后,我通过下载MySQL Workbench然后在这个应用程序中创建一个新的数据库得到了解决方案,并且它工作正常
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.