Recovering from a WP hack - MySQL issue


A while back, I got word from DH that my websites had been hacked. I host three domains with DH - all run WordPress. Two of the three were fine after I completed the actions suggested by DH. One of the WP sites displayed nothing at all, which I assumed was a result of the hack.

Not knowing what to do, I reinstalled WordPress and pointed it to the same database I had been using for that site previously. However, after the WP install, it appeared that none of my old posts, comments, etc. were present in the new WP installation.

After doing some research, it seems that this is because even though I pointed WP to the same database, the headers are different for each instance of WordPress connected to the database (pls forgive me if I’m not using the right term, I have next to zero knowledge of databases).

So, my question is… How do I:

a) Recover my old posts and import them into the new instance of WordPress. Or…
b) Tell the new instance of WordPress how to connect to the DB in a way that it will recognize (or import?) the old posts?

Thanks. Any feedback is appreciated. Let me reiterate that when it comes to databases, I am pretty much useless, so please be as detailed as you can in explaining remedies to this issue.

Thanks again!

– Jeff


by ‘reinstall wordpress’, you mean from the panel?

if so, yes, you are right. you’ll need to look at your database and copy the table prefix to your wp_config settings.


Yes - I did reinstall from the panel.

Thanks for the tip. I’ll hit Google and see if I can find some instructions for doing what you suggest.

– Jeff


@jeffrivers - If you log into your Dreamhost panel and navigate to mysql, you’ll see a list of your databases. Info about your database server, name, username and log-in info is all accessible via that page as well. You just need that and, if you originally used a one-click installation of WP, the unique pre-fix your database tables were assigned when set up. It may look something like: wp_238random#_ (you will probably have to log into the database using phpMyadmin to see your unique pre-fix - that access is linked from the database page also).

Copy all that info to the config file of your new installation (it tells you what goes where, just read the inline comments) and your new installation will talk to your existing database instead of the new, empty one created.


Awesome. Thank you for your help!

– Jeff


We have directions on how to rebuild a config file now:


Concise, well-written directions, too. thumbs up