Forums

[resolved] After install, able to access dashbooard, but database connection error on site (5 posts)

  1. babcock0214
    Member
    Posted 2 years ago #

    I'm moving a WordPress blog from GoDaddy to DirectAdmin. I created a mySQL database in DirectAdmin, uploaded my WordPress files via FTP, and changed wp-config.php to the following:

    ('DB_NAME', 'xxxxxxx');
    ('DB_USER', 'xxxxxxx');
    ('DB_PASSWORD', 'xxxxxxx'); //
    ('DB_HOST', 'localhost'); //

    I've triple-checked: the DB name, user name, and password are correct. I'm using 'localhost' for DB_HOST, as directed in WordPress and DirectAdmin support.

    Now, when I go to http://mywebsite.com/wp-admin I see the WordPress dashboard fine. But when I go to http://mywebsite.com I get this error:

    "Error establishing a database connection"

    What am I doing wrong? Please help! Thanks in advance!

  2. Gerald
    Member
    Posted 2 years ago #

    I'll like to check two things:

    • Did you set the $table_prefix correctly?
    • When you moved your blog, did you export the MySQL database and imported into your new one?
  3. babcock0214
    Member
    Posted 2 years ago #

    Good questions. I'm assuming I didn't import the new MySQL database correctly since none of my old posts appear in the new WordPress dashboard. How should I have imported my previous MySQL database? And what should I do now?! Thank you so much for your help!

  4. Gerald
    Member
    Posted 2 years ago #

    You should do a database dump using phpmyadmin or using some other MySQL administration facility your web host provides.

    Import the database dump using the same utility in your new host after that.

    Probably you should read
    http://codex.wordpress.org/Moving_WordPress
    and

    http://www.velvetblues.com/web-development-blog/how-to-move-a-wordpress-blog-or-website/

    Those might provide more detailed explanation than I can.

  5. babcock0214
    Member
    Posted 2 years ago #

    Thanks!

    I found an easy fix work-around solution: renaming index.html to index-old.html. I didn't realize that this file was already loaded in DirectAdmin. Obviously, it was causing problems with WordPress's index.php file. After renaming it, I am now able to browse to my website.

    But I will look at your solutions to see about uploading my old database. Thanks for your help!

Topic Closed

This topic has been closed to new replies.

About this Topic