我如何升级mysql ?How do I upgrade mysql?

- 此内容更新于:2014-12-30
主题:

原文:

When upgrading MySQL, I first create a backup of the database. Then I will uninstall the current version installed, and delete all the files that were left by the installer. Then I install the latest GA version, and restore the created back-up, using the MySQL Administrator.

Is there a better way of doing an upgrade of the MySQL. Because I have to create again all the users that are allowed to connect to the database.

The installation of the MySQL is used in a college enrollment system, a client server system I have developed using VB.Net and MySQL. I can only do the update at night because i know no one is connected to the database.

swilliams的回复:“Update"听起来像你,重新做一个sql查询,而不是更新整个应用程序。我编辑它更清楚。

(原文:"Update" sounds like you're doing a sql query, not updating the whole application. I edited it to make it a little clearer.)

acrosman的回复:听起来很像一个服务器升级的描述给我。

(原文:Sounds a lot like a server upgrade from the description to me.)

解决方案:
原文:

you can dump the mysql.user and mysql.db tables, which contains all the user info, and reimport that as well, to avoid having to recreate all that. i'd also suggest running repairs on the table after you re-import.

alternatively, you could create a listing of grants:

select concat('show grants for ',quote(user),'@',quote(host),';') from mysql.user

this will output a list of sql statements that you can then run to get specific grant statements.

ultimately though, you'll want to check out your specific version information regarding upgrades, to make sure you've considered any version specific compatibility issues.

here is some information for a 4.1 - 5.x upgrade, for example.

解决方案:
为什么mysql升级所以braindead ?事实上,你需要备份你的数据,安装MySQL到另一个目录,再输入你的数据,只是升级是荒谬的。必须有一个更简单的方法。
原文:

Why is the mysql upgrade so braindead? The fact that you need to back up all your data, install MySQL to a different directory, reimport your data -- just to upgrade is ridiculous. There has to be an easier way.