1

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

1 Answer 1

1

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';
Sign up to request clarification or add additional context in comments.

5 Comments

#1044 - Access denied for user 'cpses_oz8Vr6mtGH'@'localhost' to database 'mysql' error for those 2 queries by the way i can connect using localhost:8889 using MAMP with no problem user:root pass:root and for the user ozanozanozan all privillages are already given
You need to log into your database as root or as a user with full privileges to make sure that the user exists and has access to the database. If the webpage at localhost:8889 doesn't access the database at all or uses different credentials, it won't help diagnose your laravel issue.
in localhost the root user or a user that i create with full privileges has an extra parameter named host. If you set this host to localhost initially it works but if you make it any host it still doesn't work. I cannot set this thing on my hosting panel or any other interface. And also sql queries for create user doesn't work.
If it works with localhost but not another host, then the permissions for the database user are wrong. You'll have to either use localhost or correct the database user's permissions.
this setting is made while creating the user not in permissions

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.