Fix error when import Mysql 5.1 data into 5.6

How to fix error when import MySQL 5.1 data into 5.6.

When you move from older MySQL version 5.1 to newer 5.6. Maybe the error will occur when you import the old database to new one. The following steps will show you how to solve the problem.

1. Check column_count of mysql database;

SELECT COUNT(1) column_count FROM information_schema.columns WHERE table_schema=’mysql’ AND table_name=’user’;

It should be the following values.

  • If it is 43, MySQL data version is 5.6
  • If it is  42, MySQL data version is 5.5
  • If it is 39, MySQL data version is 5.1
  • If it is 37, MySQL data version is 5.0

2. Check all database.

# mysqlcheck --all-databases --check-upgrade --auto-repair

3. Upgrade to new version.

#mysql_upgrade -uroot -p  –upgrade-system-tables –force

Be the first to comment

Leave a Reply