When you upgrade MySQL, you should check all tables from all databases for incompatibilities. To do this, you can use the mysql_upgrade program. You can use mysql_upgrade to upgrade the system tables so that you can take advantage of new privileges or capabilities that might have been added.
When you run the utility, mysql_upgrade will mark all checked and repaired tables with the current MySQL version and when you run again the utility with the same version of server, it will know if there is any need to check or repair the table again. If you want to check and repair the tables, use the following commands:
mysqlcheck --check-upgrade --all-databases --auto-repair
Before version 5.1.10, for upgrade was the command mysql_fix_privilege_tables. In version 5.1.7 this command was replaced with mysql_upgrade only for Unix systems, but in version 5.1.10 was introduced mysql_upgrade for all systems.
To use it, start the server and type:
shell> mysql_upgrade .
mysql_upgrade reads options from the command line and from the [mysql_upgrade] group in option files. After you use this command restart your MySQL server.
The options for this command are:
- -?, --help
Display help message.
The path to the MySQL installation directory
The path to the data directory.
Set the default character set.
Directory where character sets are.
Use compression in server/client protocol.
Force execution of mysqlcheck even if mysql_upgrade has already been executed for the current version of MySQL.
Connect to host.
Password to use when connecting to server.
Use named pipes to connect to server.
Port number to use for connection.
The protocol of connection (tcp,socket,pipe,memory).
Base name of shared memory.
Socket file to use for connection.
User for login if not current user.
Enable SSL for connection (automatically enabled with other flags). Disable with --skip-ssl.
CA file in PEM format (check OpenSSL docs, implies --ssl).
CA directory (check OpenSSL docs, implies --ssl).
X509 cert in PEM format (implies --ssl).
SSL cipher to use (implies --ssl).
X509 key in PEM format (implies --ssl).
Verify server's "Common Name" in its cert against hostname used when connecting. This option is disabled by default.
Display more output about the process