Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Michael Fayez's avatar

Migrate database on Hostinger

I write everything correct in .env and checked that many times but I have the same error

  SQLSTATE[HY000] [1045] Access denied for user 'u754910178_quivouser'@'127.0.0.1' (using password: YES) (Connection: mysql, SQL: select * from information_schema.tables where table_schema = u754910178_quivo and table_name = migrations and table_type = 'BASE TABLE')

I contact support for solution he told me to upload database by traditional way not by php artisan migrate can anybody help me what is the mistake or wrong with this issue

0 likes
3 replies
LaryAI's avatar
Level 58

The error message you're seeing indicates that the MySQL server is rejecting the connection attempt from your application. This is typically due to incorrect database credentials (username, password, database name) or insufficient privileges for the user on the database.

Here are the steps you should follow to troubleshoot and resolve the issue:

  1. Double-Check .env File: Ensure that your .env file has the correct database credentials. The relevant lines should look something like this:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=u754910178_quivo
DB_USERNAME=u754910178_quivouser
DB_PASSWORD=your_password

Make sure that DB_DATABASE, DB_USERNAME, and DB_PASSWORD match exactly with the credentials provided by your hosting service.

  1. Clear Configuration Cache: Sometimes Laravel caches the configuration and does not pick up changes from the .env file. Run the following command to clear the configuration cache:
php artisan config:clear
  1. Check Database User Permissions: Ensure that the database user u754910178_quivouser has the necessary permissions to access the database u754910178_quivo. You can check and manage these permissions through your hosting control panel or by contacting Hostinger support.

  2. Verify Hostname: Make sure that the DB_HOST value is correct. While 127.0.0.1 is the standard for a local database, your hosting provider might use a different hostname or IP address for the database server.

  3. Test Connection Manually: Try connecting to the database manually using a database client like MySQL Workbench or via the command line to ensure that the credentials are working.

  4. Contact Support Again: If you've verified all the above and still encounter the issue, it might be a problem on the hosting provider's end. Contact Hostinger support again and provide them with the details of the steps you've taken.

If you've gone through all these steps and the credentials are correct, you should be able to run the migration with:

php artisan migrate

Remember to replace your_password with the actual password for the database user. If you're still having trouble after following these steps, please provide any additional error messages or context that might help diagnose the problem further.

gych's avatar

Did you test that everything works after you've imported the database manually (e.g. from an export of your local DB)

If after manual import your app/db connection works without issues then your DB connection is OK. If that also doesn't work, double check your DB credentials.

Randy_Johnson's avatar

@gych On your dashboard on hostinger, there should be a database section, in that section you create the database, it will give you a username and password for that db, copy and paste this into your .env file.

SSH into the server using terminal and navigate your way to the website app folder where you can then run 'php artisan migrate:fresh --seed'.

Please or to participate in this conversation.