I have installed Laravel 5 successfully and changed MySQL credentials in database.php file in config directory to \'
mysql\' => [
\'driver\'
The .env file should have same database name , username and password as in the mysql database and check whether all permissions are granted to the user for accessing the database or not. I solved my problem by adding the cpanel username in front of database name and username like jumbo_admingo and jumbo_user1 respectively where jumbo is my cpanel username and admingo is the database name i created in mysql and user1 is the user which has been provided the access to the database admingo. THIS SOLVED MY PROBLEM.
Pls Update .env file
DB_HOST=localhost
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret
After then restart server
Edit the file .env in your laravel root directory. make looks as in below :
DB_HOST=localhost
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=your-root-pas
Also create one database in phpmyadmin named, "laravel".
Run below commands :
php artisan cache:clear
php artisan config:cache
php artisan config:clear
php artisan migrate
It worked for me, XAMPP with Apache and MySQL.
This works to me:
php artisan config:clear
php artisan cache:clear
php artisan config:cache
Thanks.
I Faced Same Problem what i did
but Same problem found than i run this artisan command
php artisan view:clear
Hope it will helpful.
Reason is the old database credentials are cached /bootstap/cache/config.php
In the .env file, I modified it as follow
DB_HOST=localhost
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret
Then removed that file
/bootstap/cache/config.php
If the issue still there you might try the following.
php artisan config:clear php artisan cache:clear php artisan config:cache
Exit vagrant by writing the exit
command
Then restart vargarnt/homestead config
vagrant reload --provision
Then opened vagrant again
Vagrant Up
Vagrant ssh