The MU forums have moved to WordPress.org

Cant Establish Database Connection when exported to my site (6 posts)

  1. hanz0122
    Member
    Posted 14 years ago #

    I have installed wordpress mu on my WAMP and everything worked out fine. Now I want to export my database to my newly hosted domain to be seen on the internet but whenever I access the site it would give me an Error establishing a database connection. I have changed some of the settings in wp-config.php to:

    define('DB_NAME', 'singlesf_wpmu');

    /** MySQL database username */
    define('DB_USER', 'root');

    /** MySQL database password */
    define('DB_PASSWORD', '');

    /** MySQL hostname */
    define('DB_HOST', 'localhost');

    /** 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', '');
    define('VHOST', 'no');
    $base = '/singlesf_wpmu/';
    define('DOMAIN_CURRENT_SITE', 'singles4fun.com' );
    define('PATH_CURRENT_SITE', '/singlesf_wpmu/' );
    define('SITE_ID_CURRENT_SITE', 1);
    define('BLOGID_CURRENT_SITE', '1' );

  2. SteveAtty
    Member
    Posted 14 years ago #

    So you've built your WPMU site locally and now you want to move it to an external host?

    Is the domain name the same? If not you'll need to change things in the database.

    If the domain is the same then export the DB using sqldump or phpMyAdmin and then import it on the new host and make sure the DB user you are going to use has the right permissions.

    Copy all the files over to the new host.

    Change the DB connection information in the wp-config.php file to point to the new host.

  3. hanz0122
    Member
    Posted 14 years ago #

    Yes I built WPMU on wamp and using localhost.localdomain. I have changed many these things on the database and the wp-config.php but nothing happened so i decided to reinstall it on my new host and just copy important files later. They told me to use localhost as database host but an error prompted as I submit.

    Error establishing a database connection

    This either means that the username and password information in your wp-config.php file is incorrect or we can't contact the database server at localhost. This could mean your host's database server is down.

    * Are you sure you have the correct username and password?
    * Are you sure that you have typed the correct hostname?
    * Are you sure that the database server is running?

    If you're unsure what these terms mean you should probably contact your host.

    I used root as username and blank for password.

  4. SteveAtty
    Member
    Posted 14 years ago #

    root with a blank password - I'm glad that didn't work.

    So what user/id password did they tell you to use to connect to the database?

  5. andrea_r
    Moderator
    Posted 14 years ago #

    On your new webhost, you absolutely have to make a new database user with all permissions, then add them as a user to the database.

  6. hanz0122
    Member
    Posted 14 years ago #

    Thank you so much Andrea and Steve. I have created a new database user on MySql Databases and all went fine. I couldnt do that on phpmyadmin because it has "No Privileges". I have my website running now.

About this Topic

  • Started 14 years ago by hanz0122
  • Latest reply from hanz0122