What is mysql_upgrade?
If your server runs MySQL databases, then the mysql_upgrade command is one you’ll want to familiarize yourself with. Available only in Unix, mysql_upgrade is a command that checks all tables in all databases for incompatibilities with your current version of the MySQL Server.
After checking your databases, if a table is found to have possible incompatibilities, it is investigated in detail. If any problems are found, the table is repaired automatically.
Once all tables have been checked and repaired, they are marked with the current MySQL version number. This ensures that the next time you run the mysql_upgrade command with the same version of the server, it can determine whether there is any need to check or repair these tables again.
Another feature of mysql_upgrade is that it saves the MySQL version number into a file named mysql_upgrade.info. Contained within the data directory, this file is used to quickly review if all tables are current for this release, allowing future table-checking to be skipped.
Lastly, mysql_upgrade also upgrades the system tables. This allows users to take advantage of new privileges or capabilities that might have been added in new versions of MySQL.
For these reasons, mysql_upgrade should be executed each time you upgrade the MySQL Server to ensure that your tables remain up-to-date and compatible.
How to Use mysq_upgrade
To use mysql_upgrade, you’ll first need to make sure that your server is up and running. Then, from within the terminal, enter the following command:
shell> mysql_upgrade
The way mysql_upgrade works, is by automatically executing the following commands:
mysqlcheck --check-upgrade --all-databases --auto-repair
mysql_fix_privilege_tables
Popular Links
Looking for more information on MySQL? Search our Knowledge Base!
Interested in more articles about Databases? Navigate to our Categories page using the bar on the left or check out these popular articles:
- View the Contents of a Table in a SQL Server Database Using Enterprise Manager
- Create a MySQL Backup from Command Line – MySQL Import SQL File
- How to Install SQL Server 2012 Express on Windows Server 2012
Popular tags within this category include: MySQL, MSSQL, phpMyAdmin, PostgreSQL, and more.
Don’t see what you’re looking for? Use the search bar at the top to search our entire Knowledge Base.
The Hivelocity Difference
Seeking a better Dedicated Server solution? In the market for Private Cloud or Colocation services? Check out Hivelocity’s extensive list of products for great deals and offers.
With best-in-class customer service, affordable pricing, a wide-range of fully-customizable options, and a network like no other, Hivelocity is the hosting solution you’ve been waiting for.
Unsure which of our services is best for your particular needs? Call or live chat with one of our sales agents today and see the difference Hivelocity can make for you.