I use the command php artisan migrate to migrate my db in laravel 5 .. it gives me an error:
exception \'PDOException\' with message \'SQLSTATE[HY000] [10
In your .env file change DB_PORT from
DB_PORT=3306
to
DB_PORT=33060
refrence to https://laravel.com/docs/5.4/homestead#connecting-to-databases
becarefull about last zero
Once you changed your .env file then you must restart the server.
In laravel in command prompt, type:
php artisan serve
Run the following command:
php artisan cache:clear
php artisan config:cache
in your database.php file, take off 'DB_DATABASE'
'DB_USERNAME'
'DB_PASSWORD'
and replace with your database name, username and password
this will work fine for u.
In your Laravel .env file, alter the variables accordingly to match your desired settings.
If you're using something like XAMMP or EasyPHP with a mysql db, perhaps use the following setup
DB_HOST=localhost
DB_DATABASE=mysql
DB_USERNAME=root
DB_PASSWORD=''
Sometime in the future. Try to clear your config first
php artisan config:clear.
Close all the terminal /cmd windows and then restart terminal/CMD and this should get rid of the error message. See if it works.