php artisan migration不适用于Laravel5.4中的XAMP

我正在使用命令“ php artisan migration”,但由于用户拒绝访问而显示错误,我的所有迁移均已成功创建,但无法在localhost phpmyadmin中迁移?

在命令提示符下,我成功创建了迁移,但无法在localhost phpmyadmin中迁移,我已经尝试了所有配置设置,但没有用。

在Connection.php第647行中:

SQLSTATE [HY000] [1045]对用户'root'@'localhost'的访问被拒绝(使用密码:NO)(SQL:从信息中选择*   on_schema.tables,其中table_schema =博客,table_name =迁移)

在Connector.php第68行中:

SQLSTATE [HY000] [1045]用户'root'@'localhost'的访问被拒绝(使用密码:NO)

a704271485 回答:php artisan migration不适用于Laravel5.4中的XAMP

该错误表示为您的应用指定的数据库登录详细信息不正确。看来您没有在环境文件中提供DB_PASSWORD值。检查登录详细信息(用户名和密码),并确保用户具有访问指定数据库的特权。

要确认登录详细信息正确,请打开终端并运行: mysql -u DB_USERNAME -p(用您的数据库用户名(例如root)替换DB_USERNAME),它将提示您输入密码,输入密码(如果有),然后按Enter。如果一切顺利,您应该会看到类似以下内容:

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.18 Homebrew

Copyright (c) 2000,2019,Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> 
本文链接:https://www.f2er.com/3167515.html

大家都在问