• Hi there, I’m struggling badly with databases and MySQL. I’m updating an existing website to a WordPress site. I’ve transferred WordPress files to the root. And created a new database (MySQL5). There is an existing old database from the original. Should I export the original database and delete? I’ve updated the https://www.config.php file so should that link to the new SQL5 database?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    Export old database? Yes. Delete that old one: not yet. That’s a “no going back now!” sorta thing to do and your new installation isn’t working yet.

    Have you confirmed that the setting in your new wp-config.php file are correct for your new database? If they are you shouldn’t get that database error.

    If you haven’t create the database yourself, your host provider may be able to help you with the DB settings.

    // ** MySQL settings - You can get this info from your web host ** //
    /** The name of the database for WordPress */
    define('DB_NAME', 'database_name_here');
    
    /** MySQL database username */
    define('DB_USER', 'username_here');
    
    /** MySQL database password */
    define('DB_PASSWORD', 'password_here');
    
    /** MySQL hostname */
    define('DB_HOST', 'localhost');

    Also to play it really safe, change the $table_prefix to something new from wp_. It’s not really necessary to getting WordPress running but many people want to change it later and that’s a pain. ??

    $table_prefix  = 'ps_';
    Thread Starter padraigstapleton

    (@padraigstapleton)

    Thanks for the swift reply!

    It’s probably the hostname itself Im not sure with. Everything else seems fine, in the database user info control panel.

    /** MySQL hostname */
    define(‘DB_HOST’, ‘xxx.xx.x.xxx’);

    Should it be the IP address? The host tends to take 24 hours to reply and if i can find what the hostname is… if all is correct, should the site work ok?

    Also having a slight problem exporting the old database. It exports through MySQL as a SQL file but where does it end up?

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    Should it be the IP address? The host tends to take 24 hours to reply and if i can find what the hostname is… if all is correct, should the site work ok?

    That could be correct but check with your host provider to make sure. On my installation it’s set to localhost but for host provided databases it may be an IP or DNS name.

    Also having a slight problem exporting the old database. It exports through MySQL as a SQL file but where does it end up?

    That should be alright. The .sql file out to be a plain text file that you can view in a plain text editor. I use notepad++ but as long as you see ASCII text it should be fine.

    Thread Starter padraigstapleton

    (@padraigstapleton)

    That is fantastic, thanks very much!

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