BLOG HOME -  UK WEB HOSTING -  PHP MYSQL HOSTING -  RESELLER HOSTING -  eUKhost FORUMS -  VPS HOSTING

Transferring MySQL database to new server.

While getting transferred from one host to another you need to take many files with youm one of them is your database (MySQL)

You should backup all your database files before it is transferred. You can do it so using two methods :

1) Using third party tool such as PhpMyAdmin.

2) Using the “dump” tool which comes bundled with MySQL.

Using PhpMyAdmin :

It is a PHP script which gives ability to interact with your database.
To manage and manipulate MySQL databases use the options under the “export” section of PhpMyAdmin. Select the appropriate database and zip up the files; it can save you bandwidth and time.
Now to transferring the database onto the new server: first create a new database, unzip the files and extract the backup then restore your database.
It also lets you mess up the database directly. There is no “undo” or “undelete” in your database. Always exercise caution when working with the database.

Most host have their control panel PhpMyAdmin pre-installed.

Using dump tool :

You have to use different commands at command line environment or UNIX shell environment.

Type command :

mysqldump -u [username] -p [password] –opt [databasename] > backup.sql

this command will take backup of your database.

Now on the new server, you can restore the database by inputting the following command:

mysql -u [username] -p [password]
The options in brackets need to be filled out with the appropriate information, such as the username and password. It is also a good idea to take a “dump” of your database regularly for backup purposes in case the server fails or you have a corrupt database.

Databases for any business play a vital role so to preserve it you should take maximum precautions.

Bookmark on del.icio.us digg this

This post is compiled by eUKhost.com

Leave a Comment

You must be logged in to post a comment.