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-repairBefore 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:
- -?, --helpDisplay help message.
-b, --basedir=pathThe path to the MySQL installation
directory
-d, --datadir=pathThe path to the data directory.
--default-character-set=nameSet the default character set.
--character-sets-dir=pathDirectory where character sets are.
--compressUse compression in server/client protocol.
-f, --forceForce execution of mysqlcheck even if mysql_upgrade has already been executed for the current version of MySQL.
-h, --host=nameConnect to host.
-p, --password[=name]Password to use when connecting to server.
-W, --pipeUse named pipes to connect to server.
-P, --port=namePort number to use for connection.
--protocol=nameThe protocol of connection (tcp,socket,pipe,memory).
--shared-memory-base-name=nameBase name of shared memory.
-S, --socket=nameSocket file to use for connection.
-u, --user=nameUser for login if not current user.
--sslEnable SSL for connection (automatically enabled with other flags). Disable with --skip-ssl.
--ssl-ca=nameCA file in PEM format (check OpenSSL docs, implies --ssl).
--ssl-capath=nameCA directory (check OpenSSL docs, implies --ssl).
--ssl-cert=nameX509 cert in PEM format (implies --ssl).
--ssl-cipher=nameSSL cipher to use (implies --ssl).
--ssl-key=nameX509 key in PEM format (implies --ssl).
--ssl-verify-server-certVerify server's "Common Name" in its cert against hostname used when connecting. This option is disabled by default.
-v, --verboseDisplay more output about the process