Repair a broken wordpress with shared hosting

Recently I migrated to a shared hosting connection for my entire website, one of the problems I encountered was that it broken all of the links to my MySQL databases

When I moved the directories and files, all I was consistently receiving was database connection not available.

The problem you have with shared hosting is that all the MySQL databases must be separated. So to do this, all hosting providers give your MySQL database a leading connection.

In the form of myself, my host gives all my database names andrewho_ (then the database name)
For my databases, they were called wordpress and zencart.

My new MySQL databases are called andrewho_wordpress and andrewho_zencart. The problem is you need to repair the connection when migrating to shared hosting connection with wordpress and it’s actually really easy

Here is how to fix the SQL database problems

1) Carry out an SQL dump of the entire database
You need to back up your entire existing database, for me it was hosted on my home PC. I had the MySQL Workbench installed, so it’s just a case of selecting the “Export” option, ticking your database. Giving it a name to identify it (ending in .sql) and saving to your computer

2) Create a new database from your hosting provider for the directory where you want to install it
Your wordpress needs to be reimported with phpmyadmin to recreate all the tables and data

3) Modify your .SQL file (so it doesn’t create a new database)
One of the major problems I encountered was every time I uploaded the file, it failed. This was because my user account didn’t have permissions to create databases with the names given by the SQL files. This is because you need to reimport the data with a modified SQL file using the new details

The quick way of doing this is to open your SQL file with Notepad++ or any text editor and comment out the lines and change the database names. I have given an example of this below so it’s easier to explain.

USE `wordpress`;

Note the highlighted entries, you need to comment out (–) the option to “create” the database… in this example it wants to create a database called “wordpress” (it’s already created)

Originally it was called “wordpress”, you need to change the database name so it knows where to import the data
USE `andrewho_wordpress`;

I had to modify both my files when uploading the data other wise it break the database.

4) Once you have uploaded the files, you need to modify the wp-config.php file otherwise it will just try fail to connect to the database. This is in the following directory

Here is an example of the details on my directory…..
// ** MySQL settings – You can get this info from your web host ** //
/** The name of the database for WordPress */
define(‘DB_NAME’, ‘andrewho_wordpress‘);

/** MySQL database username */
define(‘DB_USER’, ‘andrewho_myusername (eg root, admin)‘);

/** MySQL database password */
define(‘DB_PASSWORD’, ‘My secret password‘);

/** MySQL hostname */
define(‘DB_HOST’, ‘localhost’);

Dedicated server

Did a configuration change on the website and it brought me to something I really need to work on with the limitation of this webserver. Eventually I’m going to have to migrate to a dedicated server or build myself one


This lowly quad core PC is taking a lot of brunt. I did some changes and applied some programs with my cloudflare settings, my inbound connections on MySQL went from around 4-10 to nearly 500. The PC slowed down drastically because they I/O was taking a hammering


This is the perfect time to start building my cluster of PC’s. Ā A bunch of low powered cluster computers acting as a dedicated server for my website will be faster than this PC as the load requests can be split up.

I’ll get some software and load test this PC, then find out the comparison with the new server I build

Watch this space šŸ™‚

Cannot start session without errors in phpMyAdmin

A quick one, I recently received the messageĀ Cannot start session without errors in phpMyAdmin when trying to logon


Usually when you get this message it’s normally because of your browse cache, or an issue with the session.save_path variable in the PHP.ini configuration file


I decided to check the session save path first and it turned out after I had a problem with my PHP configuration. I updated PHP but forgot to copy over the directories


My PHP was pointing to a /tmp folder. Once I created this, jobs a good un. Remember this in next time

1 2