• This is what I did:
    Exported the database to a zip file.
    Zipped the entire WordPress folder I was using locally.
    Created a database of the same name on the live site
    Imported the database
    Uploaded and unzipped the WordPress folder
    Changed the options table to the live site home page.

    I can’t get into the wp-admin – Error establishing a database connection

    What else should I do?

Viewing 6 replies - 1 through 6 (of 6 total)
  • check the details in the wp-config.php file

    Thread Starter lcvincent

    (@lcvincent)

    I did but I’m not entirely sure what I’m supposed to change.

    In the wp-config.php file:
    define(‘DB_NAME’, ‘….’); is correct

    But the DB_USER and DB_PASSWORD are set to ‘root’

    I tried copying the username and password from the sql database users file into wp-config.php but that didn’t work. Neither did adding root to the users table.

    you need to fill those in with the details of the database on your host. if you’re not sure, check with your host.

    DB_USER and DB_PASSWORD will depend on what username and password is used to access the database on your host.

    Thread Starter lcvincent

    (@lcvincent)

    As I said before, I tried copying the user and password out of the database and into the wp_config.php file. I just tried it again to be sure and it didn’t work. Since the password in the data base is encrypted, I tried copying the encrypted password and the using the regular password in the wp_config.php file and neither worked.

    Out of curiosity the ‘root’ username and password were in my local wp_config.php file but the admin username and password were in my local sql database. Why did that work on my local system and not when I uploaded it to the live site?

    You’re getting it mixed up. The values you’re supposed to use in the wp-config.php file are your DATABASE username and password. It sounds like you’re trying to use your WordPress username and password in there.

    It doesn’t work on your live site because you need to use your HOST’S DATABASE server, username and password.

    As I said before, if you don’t know those values, check with your host.

    Thread Starter lcvincent

    (@lcvincent)

    Duh. Well that helped! I guess I really don’t understand how wordpress knows which database it’s supposed to pick out of mysql if it’s not set in the wp_config file. (But it might just be too late for me to get it right now.) Thank you so much for hanging in there with me!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Moving from localhost to live site – Error establishing a database connection’ is closed to new replies.