Generate mySQL dump for mySQL 4.x and below

If you have developed a website in mySQL 5.x and your client somehow manages to purchase a hosting which supports mySQL 4.x (don’t know how this could happen but it happened to me once) then you can do the following to generate SQL script in the right version by using

mySQLDump
Go to the command prompt. Log into mySQL using the command

mysql –user=<user_name> –password=<pass_word> <db_name>

After logging in issue the command

mysqldump –compatible=mysql40 <db_name>

If you want to learn more about the other options of this great utility then visit mysql.com website.

PHPmyAdmin
This is the easier method. Login into PHPmyAdmin. Select the database. Click on Export. On the Export page you will be provided with a drop down from which you can select the format in which you want to export the dump. After selecting the desired option click on Export.

Hope the above helps.

Leave a Comment