我尝试迁移项目但出现错误
php 工匠迁移
SQLSTATE[HY000] [1044] Access denied for user 'api'@'localhost' to database 'api' (Connection: mysql, SQL: select * from information_schema.tables where table_schema = api and table_name = migrations and table_type = 'BASE TABLE')
at vendor\laravel\framework\src\Illuminate\Database\Connection.php:801
797▕ $this->getName(), $query, $this->prepareBindings($bindings), $e
798▕ );
799▕ }
800▕
➜ 801▕ throw new QueryException(
802▕ $this->getName(), $query, $this->prepareBindings($bindings), $e
803▕ );
804▕ }
805▕ }
1 vendor\laravel\framework\src\Illuminate\Database\Connectors\Connector.php:65
PDOException::("SQLSTATE[HY000] [1044] Access denied for user 'api'@'localhost' to database 'api'")
2 vendor\laravel\framework\src\Illuminate\Database\Connectors\Connector.php:65
PDO::__construct()
使用 .env 中的登录名和密码连接到 mysql 正在工作
在 php.ini 中粘贴“extension=pdo_mysql”也不起作用
验证用户API: