Stupidity and a Mysql database

This morning I woke up and decided to be stupid. I’d like to share that experience with you just incase you too would like to one day “be stupid” in the same way I have. I’ve tried to break down the overall steps into bite sized chunks so they are easier to digest.
- Step 1: Get online
- In order for this to work you need to be online. So pull a chair up to your computer, and get yourself logged in.
- Step 2: Log into CPanel
- Go to your website administration page and log in. If your site doesn’t use CPanel log into whatever flavor it uses
- Step 3: Proceed immediately to the mysql databases
- Make sure you go there right away and have in your mind that “Hey, there’s no need to worry. I know what I’m doing!”
- Step 4: Prove you know what you are doing in mysql
- The easiest and quickest way to do this is to start manipulating tables, and deleting databases. Once you get done everything should be nice and tidy if not a little sparse! If it’s not you haven’t done it right. Please go back and try again.
- Step 5: Realize you’re a dumb ass
- This is the best part of the whole experience. Doing all that work in the mysql databases and then clicking your bookmark to take you to your blogs administrative login page only to be greeted by:
Error establishing a database connection
This either means that the username and password information in your wp-config.php file is incorrect or we can’t contact the database server at localhost. This could mean your host’s database server is down.
Are you sure you have the correct username and password?
Are you sure that you have typed the correct hostname?
Are you sure that the database server is running?
If you’re unsure what these terms mean you should probably contact your host. If you still need help you can always visit the WordPress Support Forums.
- Step 6: Panic
- What good is realizing how dumb you really are if you don’t take advantage of it with a good old fashioned panic session? Unfortunately I didn’t have the benefit of an audience (aside from the dog) to witness my panicing, but if you do be sure to express to everyone the depths of your dispair. It makes for good effect, and it lets everyone know that you mean business!
- Step 7: Come to your senses
- Panic is good, but keep it on a tight leash and come to your senses in due time so you can actually start sorting the problem out. All told step one through step six should only take at the most about 10 minutes. It’s only natural that you dedicate the vast majority of that 10 minutes to panic. Once you’ve burned up your time get to work and fix it!
Now that you’ve had a taste of “being stupid” the time has come to fix the mistake. Please not this is all about fixing a particular Wordpress blog related stupidity. I in no way make any claims about how this will or will not perform in the sorting out of other types of inanity you might be prone to.
- Those backups
- Remember the wordpress backups you’re so diligent about keeping? The ones you have emailed to you on a daily basis using the Wordpress Database Backup plugin? Now is a real good time to download them from your email.
What about your weekly FTP backup you keep on your local computer? Now’s a great time to get that out as well. If for some reason you don’t backup your Wordpress files and folders on a regular basis, start. Don’t ever depend on your host to have backed it up for you. If you’re not sure where to begin with FTP backup Wordpress.org has a good guide to get you started using FTP
- Turn back time
- A backup is essentially a snapshot of what your data looked like at a previous time. It’s a like a picture, except with a backup you can take things back to what they were. In other words you can turn the clock back and fix any screwups you might be responsible for. At least to a certain extent. Some things to keep in mind about restoring a backup:
- The backup only covers from the time it was performed back. Any changes made since then aren’t part of the restoration. Meaning any posts, comments, or whatnot done since the backup was created will be lost when you restore it
- It may take the interaction of your host’s support team to restore the backup. For some reason it wouldn’t allow me to upload the backed up database and the support staff had to do it for me (another reason Hostgator rules)
- Once your database backup is restored you may very well still need to go in and add the db_username and db_password fields and ensure that it matches what you have in your wp-config.php file
- Verify you’re data has been backed up several times a week! I can’t stress this enough. Verify, verify, verify.
- Make sure you know what to do. Having all the backups in the world won’t help you a bit if you don’t know what to do with them. In otherwords practice to make sure you don’t come across any surprises. Trust me there’s nothing like going back into panic mode because you’re clueless about what you’re doing.
- Write an article about your stupidity
- This is where the rubber meets the road! It is almost obligatory to write an article about your experience. To entertain others? To educate others? A little of both? Who knows, but if you’ve just had a good old episode of “Sometimes I’m too stupid to breath” why not capitalize on it by writing an article?!



Come be stupid with me: A database misadventure…
Remember all the times you’ve come across one of those articles admonishing you to “back up all of your data”? Well, this is another one of those posts. You’ll learn first hand why you should always, always, always take the time to backup. Beyond t…
I feel your pain. Actually, I felt your pain all too seriously about 2 weeks ago, the difference being that I didn’t know that the restoration process would wipe out comments and recent posts. Before things got resolved I’d contacted the site’s designer, the coder, and BlueHost.
Wish I’d seen a post like this before I started “tweaking” my site. I’m now a staunch advocate of backing up your site.
Great post.
Chanya’s last blog post..Make Money by Giving My Money Away
Yes. You tell it, brother.
Soon you will be ready for Advanced Foulups: Deleting Selected Tables.
Chanya – It wiped out your comments and posts? Ouch! That sucks. Mine preserved everything I had. I do a daily backup and fortunately I hadn’t posted anything nor gotten any new comments in the few hours between the backup and the disaster.
Karen – Can’t wait!