You are here: Home > Help & Support > Knowledgebase > Categories > Web Hosting > MySQL

How to migrate from MySQL 4 to MySQL 5

Getting started

It is possible to migrate from MySQL 4 to MySQL 5, and take advantage of the newer release of the popular database software, by using your Gradwell UNIX shell account.

Basic configuration

Once you have logged in to shell.gradwell.net, you will need to follow the steps below from the command line:

(Any word in {UPPER CASE} should be substituted for the servers, names and temporary filenames involved)

  • mysqldump -C -Q -u {OLDUSER} -p -h {OLD_SERVER_NAME} {OLD_DB_NAME} | gzip -c > {TEMPORARY_FILE}.sql.gz
  • Check the output with zcat {TEMPORARY_FILE}.sql.gz | less
  • zcat {TEMPORARY_FILE}.sql.gz | mysql -u {NEWUSER} -p -h {NEW_SERVER_NAME} {NEW_DB_NAME}

Please log in to the new server to check that your database was set up correctly and that no errors occured before you continue to remove the temporary files and the old database from the Gradwell control panel.

  • You can remove the old file from the shell server by typing rm {TEMPORARY_FILE}.sql.gz

Alternatively if you have a smaller database then PHPMyAdmin can also be used to perform this task as it features import and export SQL options.

Advanced settings and troubleshooting

NOTE Do not use -p {PASSWORD} at the command line, or other customers will be able to see your database details.

Attachments Attachments
There are no attachments for this article.
Related Articles RSS Feed
How to manage MySQL Databases using phpMyAdmin
Viewed 1033 times since Wed, Sep 15, 2010