This is one of the often unanticipated problems faced by clients. If a client or web masters switch to dedicated web hosting server, even when upgrading with the same web hosting company we will focus on the use of MySQl database.

If you are planning to switch to dedicated hosting you should obviously back up all your website files and your Mysql databases. The former can be done via FTP but your databases should be ‘dumped’ using php MyAdmin this can be achieved by logging on to phpMyAdmin selecting your database and clicking export, you will then be taken to the export page and should select ‘save as file’ ‘compression none’ and then go. Your database will then be dumped to the download file on your hard drive.

If you’re moving your web hosting account to a dedicated server . As you are also planing to move your MySQL databse to the new dedicated server which is gonna be MySQL5 server, there going to be few changes you’ll have to make the necessary changes. You have to make some necessary chaneges to your php configuration script as well to tell your php script how to connect to the new database.

Majority of php apps client use these days include a config.php file – the name can vary some what so refer to your documentation for your application to find out where your configuration file is located. If you can locate your config.php by connecting through you FTP account as well. If you’ve been hosted on a shared hosting server.

Your config file contains lines that probably look something like this:

It contains th sql hostname,user login,password,sql name.and with in the config file you can see the files like this.

$sqlHost=”localhost”;
$sqlUserLogin=”your-domain-name”;
$sqlPassword=”yourpasswordhere”;
$sqlName=”your-domain-name”;

May be the database you’re using could not be located on the same server as your web files, you need to tell the php application to look for your database on our new server – db.localhost.com.

The updation in your MySQL database are going to do on the files would look like this:

$sqlHost=”db.localhost.com”;
$sqlUserLogin=”your-domain-name”;
$sqlPassword=”yourpasswordhere”;
$sqlName=”your-domain-name”;

This could help you to migrating your localhost MySQL to a dedicated server web hosting.

Tagged: