0

Here's the situation. I needed to create a copy of the website online so that I could redesign it and collaborate with others to redo the content. Consequently:

  • I copied a website (example.org) to test.example.org. (Copied the example.org folder entire via ssh command)
  • modified the wp-config file to connect to a new database.
  • The 4 parameters are definitely correct in wp-config. I can access the new db via chrome using the DB_host and Db_user and Db_password values I've input-ed into the wp-config.
  • Consequently, I know that the database itself is fine. Just something is creating a problem in the connection between WP and the DB. I have no idea what, and I've spent an hour trying to diagnose and solve it already.

Please help!

Ps. The website is hosted on Dreamhost. Additionally, while I can access the DB manually, the dreamhost control panel shows that the database's size is unavailable. I don't know if this is simply because it has no data, or if this is indicative of some deeper issue. Google-Fu hasn't helped.

3
  • Did you copy from a database of the same version as the one you copied to?
    – s_ha_dum
    Commented Nov 10, 2015 at 14:03
  • I'm sorry, I'm rather new to this and I don't get what that means. I simply copied the entire folder example.org to test.example.org, and created a new DB in the dreamhost control panel. Both test.example.org and example.org are using php 5.6.
    – user795028
    Commented Nov 10, 2015 at 14:08
  • 1
    MySQL, like PHP, has versions. Copy a database file to a different version and you can have trouble. But it sounds to me like you didn't copy the database at all. The database files rarely (if ever?) live in the same folder as the PHP files. I strongly suggest you get help from your host or from someone with knowledge of the systems involved and who can get hands-on to help.
    – s_ha_dum
    Commented Nov 10, 2015 at 14:14

2 Answers 2

0

Not sure if this is the case in dreamhost, but in most hosts, you need to "attach" or "assign" the db user to the db in cpanel. If you ahve not done this, you will get the error you describe.

http://www.wpwhitesecurity.com/wordpress-tutorial/wordpress-database-cpanel/

0

Okay, got it figured out. Apparently, I'd been given an old hostname by the people to whom the site belonged. Once Dreamhost tech gave me the new hostname, I saw that all the changes I'd made - to wp-config, php.ini and etc - hadn't actually been reflected in the site files. Once I made those changes, everything worked fine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.