WordPress Site Error

How To Fix WordPress Database Connection Error

If you are seeing this error above when going to your website for WordPress, you probably have a database connection string issue.  Database connection strings are found within the wp-config file. You will need to update them to the correct username and password as well as the database name. *note wp-config is found in your WordPress root directory


Reasons for seeing database error

If you have recently migrated your WordPress site, created a new database with new username, password, database name or change WordPress table prefix. Then you will need to update your connection strings found within the wp-config file of WordPress. You may have to update the username and password through MySql within side your hosting account.Below is link how to change, find and edit your connection strings.


Changing Database table prix

  1. Frist find the table prix with in phpmyadmin (usually wp_ by default)
  2. Copy it
  3. Replace the table prefix from within the wp-config file
  4. Table prefix looks like this ( $table_prefix = ‘wp_’; )
  5. Replace what you see in phpmyadmin between the two single quotes ‘ ‘ within the wp-config see link above.

Database Find And Replace Prefix

You can also do a Database find and replace by downloading your Database and using notepad ++ to find all and replace all.

  1. Open Notepad++, click file and open
  2. Find database in downloads and open in Notepad++
  3. Hold Ctrl-f and that will load the find table and replace screen
  4. Click Replace tab
  5. type in what you want to find and what you want to replace with
  6. See screen shot below

Database Find and Replace

Leave a Reply

Your email address will not be published. Required fields are marked *