简体   繁体   中英

I'm getting laravel mysql [2002] connection error

I'm getting an error mysql connection [2002] error . I have configured the .env file correctly. I'm using xampp . I also have other laravel apps on the same localhost, they're working correctly but this one isn't.

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=satrap7
DB_USERNAME=root
DB_PASSWORD=

The problem is that you did not set an DB_PASSWORD . Please grant permission for an user to satrap7 database with a password and set this to your .env file. Or ( which I do not recommend ) but for local running db should be fine set your mysql root password and set this password in your .env

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM