我在 mysql 中安装了 laravel 并设置了用户名和数据库。然后我在 Laravel 项目的 database.php 文件中输入了凭据。 'mysql' => [ 'driver' => 'mysql', 'url' => env('DATABASE_URL'), 'host' => env('DB_HOST', '127.0.0.1'), 'port' => env('DB_PORT', '3306'), 'database' => env('DB_DATABASE', 'msn_test1'), 'username' => env('DB_USERNAME', 'msn_user' ), 'password' => env('DB_PASSWORD', 'Passw0rd!'), 'unix_socket' => env('DB_SOCKET', ''), 'charset' => 'utf8mb4', 'collation' => 'utf8mb4_unicode_ci', 'prefix' => '', 'prefix_indexes' => true, 'strict' => true, 'engine' => null, 'options' => extension_loaded('pdo_mysql') ? array_filter([ PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), ]) : [], ],但是当我运行时: php artisan migrate我收到此错误: SQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost' (SQL: select * from information_schema.tables where table_schema = laravel and table_name = migrations and table_type = 'BASE TABLE')我是 Laravel 的新手。有人可以帮我设置。
2 回答
- 2 回答
- 0 关注
- 116 浏览
添加回答
举报
0/150
提交
取消