Title: Database error
Last modified: August 13, 2017

---

# Database error

 *  [polo74](https://wordpress.org/support/users/polo74/)
 * (@polo74)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/database-error-242/)
 * Hi,
 * I can connect to my database using PHPMyAdmin, I can see all the tables and eveything
   work fine.
 * But I’ve got this message “Error establishing a database connection” when I’m
   trying to connect to this my website: [https://paullehmanndesign.com/](https://paullehmanndesign.com/)
 * I’ve checked many times my wp-config.php file and the username, Database name
   and hostname are correct.
 * The same problem occur with [https://paullehmanndesign.com/wp-admin/](https://paullehmanndesign.com/wp-admin/)
 * I’ve checked my MySQL Server using this code:
 * <?php
    $link = mysql_connect(‘localhost’, ‘root’, ‘password’); if (!$link) { 
   die(‘Could not connect: ‘ . mysql_error()); } echo ‘Connected successfully’; 
   mysql_close($link); ?>
 * and it works.
 * So I really don’t know what to do to fix the issue.
 * Thank you for your help
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fdatabase-error-242%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 8 replies - 1 through 8 (of 8 total)

 *  Moderator [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [8 years, 7 months ago](https://wordpress.org/support/topic/database-error-242/#post-9406119)
 * Can you post the relevant lines of your wp-config.php file? (xxxx out the password.)
 *  Thread Starter [polo74](https://wordpress.org/support/users/polo74/)
 * (@polo74)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/database-error-242/#post-9406132)
 * Please find below the lines of my wp-config.php file:
 * <?php
    /** * The base configuration for WordPress * * The wp-config.php creation
   script uses this file during the * installation. You don’t have to use the web
   site, you can * copy this file to “wp-config.php” and fill in the values. * *
   This file contains the following configurations: * * * MySQL settings * * Secret
   keys * * Database table prefix * * ABSPATH * * [@link](https://wordpress.org/support/users/link/)
   [https://codex.wordpress.org/Editing_wp-config.php](https://codex.wordpress.org/Editing_wp-config.php)**
   [@package](https://wordpress.org/support/users/package/) WordPress */
 * // ** MySQL settings – You can get this info from your web host ** //
    /** The
   name of the database for WordPress */ define(‘WP_CACHE’, true); //Added by WP-
   Cache Manager define( ‘WPCACHEHOME’, ‘/home/paullehmqt/www/wp-content/plugins/
   wp-super-cache/’ ); //Added by WP-Cache Manager define(‘DB_NAME’, ‘xxxxx’);
 * /** MySQL database username */
    define(‘DB_USER’, ‘xxxx’);
 * /** MySQL database password */
    define(‘DB_PASSWORD’, ‘xxxxxxxxx’);
 * /** MySQL hostname */
    define(‘DB_HOST’, ‘xxxxx.mysql.db’);
 * /** Database Charset to use in creating database tables. */
    define(‘DB_CHARSET’,‘
   utf8’);
 * /** The Database Collate type. Don’t change this if in doubt. */
    define(‘DB_COLLATE’,”);
 * [redacted]
    -  This reply was modified 8 years, 7 months ago by [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/).
    -  This reply was modified 8 years, 7 months ago by [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/).
 *  Moderator [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [8 years, 7 months ago](https://wordpress.org/support/topic/database-error-242/#post-9406139)
 * What looks odd to me is the DB_HOST definition. That does not look like a proper
   host name. Please verify the database host name with your hosting provider.
 *  Thread Starter [polo74](https://wordpress.org/support/users/polo74/)
 * (@polo74)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/database-error-242/#post-9406153)
 * Thanks for your answer. I’ve changed it to:
 * /** MySQL hostname */
    define(‘DB_HOST’, ‘mysql55-264.perso’);
 * But now it doesn’t show anything when I try to open my website:
 * [https://paullehmanndesign.com/](https://paullehmanndesign.com/)
 *  Moderator [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [8 years, 7 months ago](https://wordpress.org/support/topic/database-error-242/#post-9406164)
 * There’s a 500 error, so whether that new one is a valid DB host name or not, 
   I think you made an error when you edited the file.
 *  Thread Starter [polo74](https://wordpress.org/support/users/polo74/)
 * (@polo74)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/database-error-242/#post-9406215)
 * Thanks,
 * I’ve changed the name of my .htaccess file to .htaccess.bak
 * but it still doesn’t work
 * Any idea what else could it be please ?
 *     ```
       <?php
       /**
        * The base configuration for WordPress
        *
        * The wp-config.php creation script uses this file during the
        * installation. You don't have to use the web site, you can
        * copy this file to "wp-config.php" and fill in the values.
        *
        * This file contains the following configurations:
        *
        * * MySQL settings
        * * Secret keys
        * * Database table prefix
        * * ABSPATH
        *
        * @link https://codex.wordpress.org/Editing_wp-config.php
        *
        * @package WordPress
        */
   
       // ** MySQL settings - You can get this info from your web host ** //
       /** The name of the database for WordPress */
       define('WP_CACHE', true); //Added by WP-Cache Manager
       define( 'WPCACHEHOME', '/home/paullehmqt/www/wp-content/plugins/wp-super-cache/' ); //Added by WP-Cache Manager
       define('DB_NAME', 'xxx');
   
       /** MySQL database username */
       define('DB_USER', 'xxx');
   
       /** MySQL database password */
       define('DB_PASSWORD', ‘XXXXX’);
   
       /** MySQL hostname */
       define('DB_HOST', ‘mysql55-264.perso’);
   
       /** Database Charset to use in creating database tables. */
       define('DB_CHARSET', 'utf8');
   
       /** The Database Collate type. Don't change this if in doubt. */
       define('DB_COLLATE', '');
   
       [redacted]
       ```
   
    -  This reply was modified 8 years, 7 months ago by [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/).
    -  This reply was modified 8 years, 7 months ago by [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/).
    -  This reply was modified 8 years, 7 months ago by [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/).
 *  Moderator [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [8 years, 7 months ago](https://wordpress.org/support/topic/database-error-242/#post-9406220)
 * If you *only* edited wp-config.php, then the error is there. Look closely at 
   the line you edited and the lines right above and below it.
 * Looking at lines like `define('DB_PASSWORD', ‘XXXXX’);`, it seems to me that 
   the first string is delimited by a `'` as is proper, but the second is delimited
   by `’` which seems to be a different character.
    -  This reply was modified 8 years, 7 months ago by [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/).
 *  Thread Starter [polo74](https://wordpress.org/support/users/polo74/)
 * (@polo74)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/database-error-242/#post-9406252)
 * Thanks a lot.
 * It was just a “‘” instead of a “’”
 * I’ve spent all my evening trying to get if fixed.
 * I’m gonna do a backup now….
 * Thanks again Steve !

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Database error’ is closed to new replies.

## Tags

 * [Database Error](https://wordpress.org/support/topic-tag/database-error/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 8 replies
 * 2 participants
 * Last reply from: [polo74](https://wordpress.org/support/users/polo74/)
 * Last activity: [8 years, 7 months ago](https://wordpress.org/support/topic/database-error-242/#post-9406252)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
