PHP migration with managed MySQL


When I try to run migrations on App Platform during deploy, php artisan migrate --force, I get the following error even though I granted for db_user: SELECT, GRANT OPTIONS on information_schema, and GRANT ALL on my_schema_name.


In Connection.php line 712: SQLSTATE[HY000] [1045] Access denied for user ‘db_user’@‘IP_ADDRESS’ (using password: YES) (SQL: select * from information_schema.tables where table_schema = my_schema_name and table_name = migrations and table_type = ‘BASE TABLE’)

In Connector.php line 70:
SQLSTATE[HY000] [1045] Access denied for user ‘db_user’@‘IP_ADDRESS’ (using password: YES)

Do you have any idea how to resolve this problem?

Submit an answer
Answer a question...

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
March 10, 2022


In addition to what has already been mentioned, keep in mind that MySQL sets privileges based on account names, which consist of a user name and a hostname in the format 'user_name'@'host_name'. You can specify the host by name with wildcard characters (like %, as in 'user_name'@'%', which matches all hosts).

That way the MySQL user that you are using would be able to connect from the App platform to the managed MySQL cluster.

For more information about the user privileges, check out the documentation here:



Site Moderator
Site Moderator badge
March 10, 2022

Hu @NikolaMilic,

From the error, you are receiving I see two possible issues, either the user you are trying to connect does not have the proper permissions OR your password is not correct.

Additionally, check the following Docs for your app-platform and how to add managed databases to it: