我收到此错误:
SQLSTATE[HY000] [1045] Access denied for user 'root122'@'localhost' (using password: YES) (SQL: select * from `basic_settings` limit 1)
我能够在本地主机上运行数据库,但是在尝试在共享主机上运行该数据库时收到此错误。
以下是我的 database.php 内容:
'mysql' => [
'driver' => 'mysql',
'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'mitchinvest_1234'),
'username' => env('DB_USERNAME', 'root122'),
'password' => env('DB_PASSWORD', '****'),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
'strict' => true,
'engine' => null,
],
这是我的 .env 内容:
DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=mitchinvest_1234
DB_USERNAME=root122
DB_PASSWORD=****
要在共享托管中运行它,我需要做什么?