2

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?

1 Answer 1

0

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
3
  • 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. Jan 27, 2012 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. Jan 30, 2012 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. Feb 16, 2012 at 19:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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