Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I have MySQL 5.0 and 5.5 servers (but not a 5.1 server). The 5.0 server is myisam only, the 5.5 default is innodb. I need to move a database from the 5.0 server to the 5.5 server. The database is not big, the dump is about 32M. Both servers are Linux.

I ran a test by importing the 5.0 database into the 5.5 (after editing dumpfile from MYISAM to INNODB) server and then diffing mysqldumps from both servers. If I use --order-by-primay for the dump, the diffs are only what I would expect (version, engine, dump time, etc).

Any gotchas that I am missing? Can I import a myisam 5.0 database into a 5.5 innodb server without bad surprises?

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

A mysqldump will attach ENGINE=MyISAM and ENGINE=InnoDB to every CREATE TABLE statement.

You should be fine.

WARNING : There is one gotcha !!!

The mysql database itself (where the grant tables reside) have different column layouts between versions of mysql.

You can dump all databases from MySQL 5.0 EXCEPT the mysql database.

It is much better to port the mysql grants using pt-show-grants.

Here is my personal emulation of what pt-show-grants does

mysql -hhostaddr -umyuserid -pmypassword --skip-column-names -A -e"SELECT CONCAT('SHOW GRANTS FOR ''',user,'''@''',host,''';') FROM mysql.user WHERE user<>''" | mysql -hhostaddr -umyuserid -pmypassword --skip-column-names -A | sed 's/$/;/g' > MySQLUserGrants.sql
share|improve this answer
I should have put this into the question: I edited the dump file from the 5.0 database from ENGINE=MyISAM to ENGINE=InnoDB. I am being paranoid here, just want to make sure that jumping versions won't doing anything crazy. –  names_are_easy Jan 27 '12 at 22:25
I will only be importing selected databases and the mysql database will definitely not be one of them. Looks like this will work. –  names_are_easy Jan 30 '12 at 13:51
This worked. If you don't have a lot of databases (and NOT the mysql database) it is an easy way to switch to INNODB and 5.5. The one trick is that when you create the dumpfile, use mysqldump --order-by-primary. –  names_are_easy Feb 16 '12 at 19:18
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.