我尝试将我的项目部署到 AWS EC2 服务器上,但当我尝试运行 php artisan migrate
时,出现以下错误:
PDOException::("SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO)")
PDO::__construct("mysql:host=127.0.0.1;port=3306;dbname=myDb", "root", "", [])
以下是我的 .env 文件内容:
PP_NAME="MyProject"
APP_ENV=local
APP_KEY=base64:UTBgGqkc11OYbnGGJVe32xFluhFeNw288oH0UcmMYqU=
APP_DEBUG=true
APP_URL=http://localhost
LOG_CHANNEL=stack
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=myDb
DB_USERNAME=root
DB_PASSWORD=