• I’ve download wordpress to a folder on a rhel8 web server (apache).
    From the command line, I can connect to my remote database server and database with:
    mysql -u snv-admin -p -h rhelwpdb -D snv

    However, when I use these same parameters of wp-admin/setup-config.php or manually in wp-config.php, I get the ‘Error establishing a database connection’ message

    Any idea what I could be doing wrong?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Do not modify the setup-config file.
    You database connection string should only be outlined in the wp-config file.

    Have you GRANTed all privledges in the rhelwpdb db to the snv-admin user ?

    https://stackoverflow.com/questions/5016505/mysql-grant-all-privileges-on-database

    is your wp-config file 440 or 400 ?

    Do you get the error when you are accessing the site via https://<domain/site>/wp-admin?

    Please make sure that your database login credentials are correct. There are instances wherein you copy and paste the username/password and white spaces are included. Double check it on your wp-config.php.

    If you are sure that your database credentials are correct. You can check if your database is not corrupted by adding the following line to your wp-config.php:
    define( ‘WP_ALLOW_REPAIR’, true );
    However, make sure you have a backup copy of the database before proceeding. Visit you site via https://<domain/site>/wp-admin/maint/repair.php
    Press ‘Repair Database’ and wait for it to finish. Once finished, remove the added line.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Error establishing a database connection’ is closed to new replies.