简体   繁体   English

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

[英]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文件中更改hostusernamepassword等所有内容

database.php and config.php file, but it didn't work well database.phpconfig.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.

相关问题 当我尝试在我的 Wordpress 网站上加载页面时,我该如何解决这个错误? - How do I fix this error I get when I try to load pages on my Wordpress site? 当我尝试插入表格时,如何从哪里修正错误? - how can I fix my error from where in at the moment when I try to insert to my table? 当我在终端中输入“php artisan migrate”时,我看到错误 - When I type "php artisan migrate" in terminal, I see error 当我尝试从CodeIgniter中的控制器功能进行多个模型调用时出现MySQL错误1054 - MySQL error 1054 when I try more than one model call from a controller function in CodeIgniter 当我尝试使用注释参数创建自定义消息时。 我收到[语法错误] - When I try to create a custom message with annotation argument. I get [Syntax Error] 当我尝试在浏览器中运行此PHP文件时,收到错误消息 - When I try to run this PHP file in a browser, I get an error message 当我尝试使用Memcached设置值时,为什么总是返回Memcached :: RES_NO_SERVERS? - How come I always get back Memcached::RES_NO_SERVERS when I try to set a value with Memcached? 当我在终端中运行“php artisan migrate”代码时,我无法在 http://localhost/phpmyadmin/ 上创建表 - When I run "php artisan migrate" code in terminal I can't create table on http: // localhost / phpmyadmin / 当我尝试迁移 laravel 中的表时,我不断收到以下错误 - When i try and migrate my tables in laravel i keep getting the following error 插入2个数据时尝试catch总是返回错误 - Try catch always return error when I insert 2 data
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM