Forums

I get constantly "error establishing database cnnection (20 posts)

  1. marcus12456
    Member
    Posted 8 months ago #

    This is mine config.php code:

    <?php
    /**
     * The base configurations of the WordPress.
     *
     * This file has the following configurations: MySQL settings, Table Prefix,
     * Secret Keys, WordPress Language, and ABSPATH. You can find more information
     * by visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing
     * wp-config.php} Codex page. You can get the MySQL settings from your web host.
     *
     * This file is used by the wp-config.php creation script during the
     * installation. You don't have to use the web site, you can just copy this file
     * to "wp-config.php" and fill in the values.
     *
     * @package WordPress
     */
    
    // ** MySQL settings - You can get this info from your web host ** //
    /** The name of the database for WordPress */
    define('DB_NAME', '...');
    
    /** MySQL database username */
    define('DB_USER', '...');
    
    /** MySQL database password */
    define('DB_PASSWORD', '...');
    
    /** MySQL hostname */
    define('DB_HOST', '...');
    
    /** 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', '');
    
    /**#@+
     * Authentication Unique Keys and Salts.
     *
     * Change these to different unique phrases!
     * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
     * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
     *
     * @since 2.6.0
     */
    define('AUTH_KEY',         'put your unique phrase here');
    define('SECURE_AUTH_KEY',  'put your unique phrase here');
    define('LOGGED_IN_KEY',    'put your unique phrase here');
    define('NONCE_KEY',        'put your unique phrase here');
    define('AUTH_SALT',        'put your unique phrase here');
    define('SECURE_AUTH_SALT', 'put your unique phrase here');
    define('LOGGED_IN_SALT',   'put your unique phrase here');
    define('NONCE_SALT',       'put your unique phrase here');
    
    /**#@-*/
    
    /**
     * WordPress Database Table prefix.
     *
     * You can have multiple installations in one database if you give each a unique
     * prefix. Only numbers, letters, and underscores please!
     */
    $table_prefix  = 'wp_';
    
    /**
     * WordPress Localized Language, defaults to English.
     *
     * Change this to localize WordPress. A corresponding MO file for the chosen
     * language must be installed to wp-content/languages. For example, install
     * de_DE.mo to wp-content/languages and set WPLANG to 'de_DE' to enable German
     * language support.
     */
    define('WPLANG', 'nl_NL');
    
    /**
     * For developers: WordPress debugging mode.
     *
     * Change this to true to enable the display of notices during development.
     * It is strongly recommended that plugin and theme developers use WP_DEBUG
     * in their development environments.
     */
    define('WP_DEBUG', false);
    
    /* That's all, stop editing! Happy blogging. */
    
    /** Absolute path to the WordPress directory. */
    if ( !defined('ABSPATH') )
    	define('ABSPATH', dirname(__FILE__) . '/');
    
    /** Sets up WordPress vars and included files. */
    require_once(ABSPATH . 'wp-settings.php');
  2. Roy
    Member
    Posted 8 months ago #

    Cool, throw your database info out in the open! The subject line might was well have been "he, I'd like to get hacked!".

  3. marcus12456
    Member
    Posted 8 months ago #

    Hello Roy,

    These are fake infos, but what I need to know if the code is correct?

  4. Roy
    Member
    Posted 8 months ago #

    Marcus, you don't give much information.
    1 Did you create a database?
    2 Did you create a user?
    3 Did you assign a password for that user?
    4 Are you absolutely sure that the correct info is in wp-config?
    5 Did you upload all WP files?
    6 Did you upload (and rename!) wp-config-sample.php
    7 What are you doing when getting the error?

    Or
    a Did you have an up and running and working website?
    b What did you do before getting the error? (Upgrade, install or delete plugins or themes, edit files, drop database tables, change passwords, get hacked, ...)

  5. prace
    Member
    Posted 8 months ago #

    a Did you have an up and running and working website?
    b What did you do before getting the error? (Upgrade, install or delete plugins or themes, edit files, drop database tables, change passwords, get hacked, ...)

    I've got the same problem. And I deleted the old folder with drupal and installed wordpress. Now I can't get it running. I've done everything above (1-7)

  6. Roy
    Member
    Posted 8 months ago #

    Prace, the error gives a couple of 'did you's. Did you try them all?

  7. prace
    Member
    Posted 8 months ago #

    yes

  8. Roy
    Member
    Posted 8 months ago #

    You're not trying to connect WP to a Drupal database are you?

  9. prace
    Member
    Posted 8 months ago #

    never mind... wrong password

  10. marcus12456
    Member
    Posted 8 months ago #

    Good afternoon Roy,

    I am trying a WP tot a joomla database

  11. Roy
    Member
    Posted 8 months ago #

    I never tried, but theoretically I guess that should be possible. WP will make new tables, etc... Do you have the option to try a new database for WP just to see if that helps or are you limited to one database?

    Oh, and you never answered my 10 questions (only the person who hijacked your thread did).

    And now I'm wondering if there could be a user conflict with Joomla and WP in one database. Did you create a new user for WP?

  12. marcus12456
    Member
    Posted 8 months ago #

    Sorry, I did do 1 - 7

    But when I type mine adress: http://www.mbcreative.nl it doesn't work.

    I will try to set up a new database

  13. Roy
    Member
    Posted 8 months ago #

    I get another error than the database error. Make sure all WP files are where they should be.

    Btw, when you say the database is also used for Joomla, you don't have Joomla files and WP files in the root do you?

  14. marcus12456
    Member
    Posted 8 months ago #

    All Joomla files are deleted and I use a new database.

    Just through ftp a new WP version uploaded and I still get the same words

  15. Roy
    Member
    Posted 8 months ago #

    Parse error: syntax error, unexpected T_LNUMBER in /home/mbcreative.nl/www/wp-config.php on line 16

    Another thing to look at. Is wp-config correct? That could explain both errors...
    http://codex.wordpress.org/Editing_wp-config.php

  16. marcus12456
    Member
    Posted 8 months ago #

    Roy,

    I get on this moment:

    Parse error: syntax error, unexpected T_LNUMBER in /home/mbcreative.nl/www/wp-config.php on line 16

    Is this progress?

  17. Roy
    Member
    Posted 8 months ago #

    We were typing synchronically :-) Did you see my anwer/question?

  18. marcus12456
    Member
    Posted 8 months ago #

    I copied the complete config code from the website, which you gave me and added "nl_NL" and the additional pasword and dbase names.

    Result is error establishing a database connection.

  19. MattyRasker
    Member
    Posted 8 months ago #

    Have you checked that you have the right hostname, username and password in your wp-config.php file?

    Have a look at this: http://en.forums.wordpress.com/topic/error-establishing-a-database-connection-1

  20. Roy
    Member
    Posted 8 months ago #

    Marcus, do you have a Dutch installation? I can imagine that a 'Dutch WP config' and an English installation might not work well.

Reply

You must log in to post.

About this Topic

Tags

No tags yet.