Laravel 5 database connection issue

- 1 answer

Ad

When I try to connect my Laravel project to Mysql database like;

APP_ENV=production
DB_HOST=160.153.16.56:3306
DB_USERNAME=ozanozanozan
DB_DATABASE=software_db
DB_PASSWORD=ozanvolkan1

and I run php Artisan migrate,

I see an alert like:

enter image description here

Ad

Answer

Ad

Check your database permissions. First make sure that the user 'ozanozanozan'@'88.246.41.148' exists in database,

SELECT User,Host FROM mysql.user WHERE User = 'ozanozanozan'; 
// This will show all of the hosts that user can connect from

and make sure that the user has access to the software_db database.

SHOW GRANTS FOR 'ozanozanozan'@'88.246.41.148';
Ad
source: stackoverflow.com
Ad