HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlMinor

Migrating/Upgrading a MySQL 5.1 schema to MySQL 5.7 schema

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
mysqlmigratingschemaupgrading

Problem

I'm bit green on MySQL upgrades, but my question has to do with single schemas (dbs). I have some hosted databases on a server using MySQL 5.1 Community, and I currently use mysqldump to back those databases up. When I go to restore them into the MySQL 5.7 server, do I need to run an upgrade on those databases to bring them "up to speed"?

The mysql_upgrade command seems to be related to all database within an instance, and I will be moving dbs one at a time into the server that has had dbs created from scratch there, as well as other dbs that have been moved to it from the previous version (5.1).

Solution

Some things, such as microsecond in TIMESTAMP, will automatically be available because the CREATE TABLE on 5.7 will use the new format. innodb_file_per_table has a new default, so the tables will be laid out differently. That should not be a problem.

mysql_upgrade is for converting the mysql tables and for ALTERing to accommodate microseconds, etc, in an existing mysql instance where you are updating the software, not where you are loading the data.

Coming forward from 4.0 can cause troubles with changed syntax, the addition of CHARACTER SET, etc. But 5.1 is not that much different for what you are doing than 5.7.

There have been lots of changes/additions to mysql, information_schema, and performance_schema. So, be sure not to dump and reload them.

Use pt-show-grants if you need to carry GRANTs forward. Then check the results.

Do you have specific examples of things that concern you?

Context

StackExchange Database Administrators Q#123154, answer score: 3

Revisions (0)

No revisions yet.