Error establishing a database connection?
By Tracy on January 28th, 2010Posted In: Blog

Sad to say, there may come a day (or perhaps, today is that day) when visitors to your site will report that while attempting to access pages on your site they encountered the above error message.
Meanwhile on your end, as you attempt to access your blog’s login page, you are recieving an error message stating that your databases are unavailable and require repair.
These messages indicate that your site has crashed. Your databases have become corrupted.
Don’t panic (or if you already are, stop). Panicking is a waste of time better spent trying to repair the databases.
The first thing to do is to log into your webhost’s Control Panel and look for the tab labeled “MySQL Databases”. This tab will have a link called “Open database utilities”. Open it. The utility page will probably confirm that your MySQL (the back end of your blog) tables have become corrupted. The page will show you links to click that will automatically repair the broken databases.
Other self-hosting panels will send you directly to phpMyAdmin. phpMyAdmin is a tool that essentially creates an online control panel for you to manage the existing databases of your blog. If you do not already have phpMyAdmin, then I recommend you get it here. (install phpMyAdmin)
1. In step 1 of the phpMyAdmin installation, read the GNU General Public License Agreement, which governs your use of phpMyAdmin. If you agree to the terms of this agreement, click the “I Agree to These Terms” button. (If you disagree, click “Cancel.” You will not be able to continue with your installation of phpMyAdmin.)
2. Choose a directory in your site where you want to install/save phpMyAdmin (or create a new directory)
Note: To simplify your ongoing file management, I recommend that you install phpMyAdmin in a unique directory with an easily identifiable name, such as phpmyadmin or mysql_admin.
3. One of the downloaded files will be called: user_password.php; This file will show you a link to your phpMyAdmin home page. Click the link to get started using phpMyAdmin.
Note: You can access the tool anytime by visiting your phpMyAdmin home page at http://www.yourdomain.com/subdirectory/, replacing yourdomain.com with your own domain name and subdirectory with the name of the site folder in which your phpMyAdmin files are installed. You’ll be asked to sign in using your MySQL user name and password.
4. When phpMyAdmin loads in your browser you will see a dropdown menu to your left. Click on it until you get to the database that looks like shorthand for WordPress (like wrdpr**) or the name of the site you are trying to fix. Open the file. Here you will see all of the databases that make up the backend of your WordPress blog. Search for the “Check All” button. Under the “Check All” button you should see a “With Selected” drop down menu. In that menu you will see “Repair Table”. Click on that and wait while your databases get repaired.
If these steps do not work, then contact your webhost and/or attempt to rebuild your databases using your backup files. If you don’t have backups, then take a deep breath, relax, and start rebuilding your site from scratch. Don’t worry, it happens.
When you finally get your site up (or have created a new one) you should schedule REGULAR, OFTEN and FREQUENT backups of your site. (i.e: DAILY!). WordPress.org users should immediately install the WordPress Database Backup plugin to do this.
If you are the user of a free blogging tool (including WordPress.com) you probably do not manage your blog’s databases and so will never encounter this particular problem. Still, I encourage you to create your own database of your blog’s content by utilizing a third party backup solution, just in case your bloghost crashes one day or goes defunct taking your blog with it.
REMINDER: Make REGULAR, OFTEN and FREQUENT backups of your site!
| Mar 9, 2010 | Make More Comments. Get More Views |
| Mar 4, 2010 | Question: Should I make comic available in an app or by RSS? |
| Feb 25, 2010 | Question: Should I buy advertising for my webcomic? |
| Feb 22, 2010 | Question: When to schedule posts? |
| Feb 18, 2010 | Question: Should you post RERUNS?!! |
© ‘2010’ All Rights Reserved | Tracy Brady Cartoons is powered by WordPress with CommPress | Subscribe: RSS Feed | Back to Top ↑

Excellent article. I think it is something we will all encounter sooner or later.