If you are changing versions, DO NOT MOVE THE mysql SCHEMA.

Why should you not move the mysql folder? It has to do with the authentication privileges.

The number of columns in mysql.user is different from version to version

If you run `desc mysql.user`

- You will see 17 rows for MySQL 4.1
- You will see 37 rows for MySQL 5.0
- You will see 39 rows for MySQL 5.1
- You will see 42 rows for MySQL 5.5

I wrote about this before

- http://dba.stackexchange.com/questions/16397/cannot-grant-privileges-as-root/16441#16441
- http://dba.stackexchange.com/questions/16215/mysql-users-deleted/16261#16261

It is OK to move everything else.

So, the question remains, how to you move the User Privileges in the old MySQL 5.1.41 to MySQL 5.5.24 ???

There are two ways to do this:

##METHOD #1 : Use [**pt-show-grants**][1]

This Percona Toolkit program move print out the User Permission in Pure SQL. You could run the result output into a Text File. Then, execute the Text File in MySQL 5.5.24. End of Story.

##METHOD #2 : Emulate pt-show-grants

I made my own technique for pt-show-grants

    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

I wrote about this before : http://dba.stackexchange.com/questions/11818/importing-myisam-5-0-database-into-a-5-5-innodb-server/11820#11820

  [1]: http://www.percona.com/doc/percona-toolkit/2.0/pt-show-grants.html