Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DB connection error Laravel #629

Open
humzakhaled opened this issue Jan 17, 2023 · 1 comment
Open

DB connection error Laravel #629

humzakhaled opened this issue Jan 17, 2023 · 1 comment

Comments

@humzakhaled
Copy link

humzakhaled commented Jan 17, 2023

  • Corcel Version: *
  • Framework Name & Version: Laravel 8.65
  • PHP Version: 8
  • Database Driver & Version: mysql

Description:

'wordpress' => [ // for WordPress database
'driver' => 'mysql',
'host' => 'localhost',
'database' => 'my_database',
'username' => 'my_user_name',
'password' => 'my_db_password',
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => 'wp_',
'strict' => false,
'engine' => null,
],

I've put actual database , username and password credentials in the above array inside config/database.php. All other parameters are same as it is.

I've also rechecked the credentials by logging into phpmyadmin and they are working correct. But when i use them to fetch records from DB, I get the following error.

SQLSTATE[HY000] [1045] Access denied for user 'u363970340_LgAuH'@'localhost' (using password: YES) (SQL: select * from wp_posts where (post_status = publish or (post_status = future and post_date <= 2023-01-17 11:09:11)))

Please guide me on this one.

@josedarci
Copy link

To fix this issue, please check the following points:

  1. Verify that the database credentials are correct. Make sure that the username and password provided in the config/database.php file match the correct credentials for your database.

  2. Ensure that the user 'u363970340_LgAuH' has permission to access the database from the 'localhost' host. Check the user's permissions in the database to ensure they have adequate privileges to execute queries.

  3. Make sure the database is running and accessible. Verify that the database server is running and that the 'localhost' host is properly configured to connect to the database server.

  4. Check if the config/database.php file is being properly loaded and if the configurations are being applied correctly. Verify that the file is in the correct location and that there are no syntax or configuration errors in the file.

If you have already checked all of these points and are still experiencing the issue, it may be helpful to check the database error logs for more information on the cause of the error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants