Categories
Allgemein Linux

MySQL: Convert dump from MySQL4 to MySQL5

Convert an old MySQL V4 Dump to MySQL V5. In my case the old database was in Latin1/ISO format and the db-engine was MyISAM.

# on the old server (mysql4x)
mysqldump --default-character-set latin1 testdb > testdb.sql

# on the new server (mysql5x)
# tweak ENGINE
sed -i -e 's/TYPE=MyISAM/ENGINE=MyISAM/' testdb.sql
mysql --default-character-set latin1 -D testdb < testdb.sql

Not sure if there are other SQL syntax changes from V4 to V5, in my case (simple database) it worked.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.