1.7.1 upgrade with Mysql_upgrade upgrade Authorization form (1)
This upgrade method is more convenient, through the Mysql_upgrade command can be completed. Here's a demonstration of the entire upgrade process.
1) Modify the MY.CNF configuration file because the parameters in MySQL5.1 are not recognized in the 5.5 version.
- #skip-locking in 5.5, changed to
- Skip-external-locking
- #log-long-format in 5.5, changed to
- Log-short-format
- #log_slow_queries have not been recognized in 5.5, changed to
- Slow-query-log
- #Default-character-set = UTF8 has not been recognized in 5.5, changed to
- Character-set-server = UTF8
- #注释掉default_table_type = MyISAM? It's not recognized in 5.5 .
- #注释掉MyISAM_max_extra_sort_file_size's not been recognized in 5.5.
- #innodb_file_io_threads已经不识别了, change into
- Innodb_read_io_threads = 8
- Innodb_write_io_threads = 8
- # Change the previous built-in file format to Barracuda
- Innodb_file_format = Barracuda
- #注释掉同步的信息, otherwise start the times wrong
- #master-host = 192.168.110.20
- #Master-user = repl
- #Master-password = repl
- #master-connect-retry=
- #另如果你采用了InnoDB-plugin, write it off.
- #ignore_builtin_innodb
- #plugin-load=innodb=ha_innodb_plugin.so; innodb_trx=ha_innodb_plugin.so; innodb_locks=ha_innodb_plugin.so; innodb_lock_waits=ha_i
- nnodb_plugin.so; innodb_cmp=ha_innodb_plugin.so; innodb_cmp_reset=ha_innodb_plugin.so; innodb_cmpmem=ha_innodb_plugin.so;innodb_c
- mpmem_reset=ha_innodb_plugin.so
2) Modify Innodb_fast_shutdown equals 0. Let's take a look at what this parameter does.
Explanation: When MySQL is turned off, it is set to 1, does not erase dirty pages and insert buffer merge operations, and does not brush dirty pages into disk. Set to 0 to clean up dirty pages and insert buffer merge operations, and to brush dirty pages into the disk, so set the shutdown speed is the slowest. Set to 2, do not clean the dirty page and insert buffer merge operation, do not brush the dirty page into the disk, but instead of brush into the redo log transaction log, the next time it starts MySQL resume, the shutdown speed is the fastest. When you do an upgrade or downgrade operation, you should set it to 0 to ensure data integrity and avoid errors. This parameter supports dynamic modification.
The command to set this parameter is as follows:
- Set global innodb_fast_shutdown=0;
For an introduction to the Innodb_fast_shutdown parameters, see the MySQL5.5 Manual:
3) Close the MySQL service with the following command:
- /etc/init.d/mysql stop or mysqladmin-uroot-p123456 shutdown
4) Skip the MySQL authorization form to start the MySQL service with the following command:
- MySQLd --defaults-file=/etc/my.cnf--skip-grant-tables &
5) Perform the update as follows:
- [Email protected] mysql]#/usr/local/mysql/bin/mysql_upgrade
- Looking for ' MySQL ' As:bin/mysql
- Looking for ' Mysqlcheck ' As:bin/mysqlcheck
- Running ' Mysqlcheck ' with connection arguments: '--port=3306 '--socket=/tmp/mysql.sock '
- Running ' Mysqlcheck ' with connection arguments: '--port=3306 '--socket=/tmp/mysql.sock '
- Mysql.columns_priv OK
- Mysql.db OK
- Mysql.event OK
- Mysql.func OK
- Mysql.general_log OK
- Mysql.help_category OK
- Mysql.help_keyword OK
- Mysql.help_relation OK
- Mysql.help_topic OK
- Mysql.host OK
- Mysql.ndb_binlog_index OK
- Mysql.plugin OK
- Mysql.proc OK
- Mysql.procs_priv OK
- Mysql.servers OK
- Mysql.slow_log OK
- Mysql.tables_priv OK
- Mysql.time_zone OK
- Mysql.time_zone_leap_second OK
- Mysql.time_zone_name OK
- Mysql.time_zone_transition OK
- Mysql.time_zone_transition_type OK
- Mysql.user OK
- Test.heartbeat OK
- test.log20111127 OK
- test.log20111128 OK
- test.log20111129 OK
- test.log20111130 OK
- test.log20111201 OK
- test.log20111202 OK
- test.log20111203 OK
- test.log20111204 OK
- test.log20111205 OK
- test.log20111206 OK
- test.log20111207 OK
- Test.t1 OK
- Test.t2 OK
- Running ' Mysql_fix_privilege_tables ' ...
- Ok
.7.1 Upgrade with Mysql_upgrade upgrade Authorization form (2)
6) Close the MySQL service again with the following command:
- /etc/init.d/mysql stop or mysqladmin-uroot-p123456 shutdown
7) normal start MySQL service, command as follows:
- Mysqld_safe --defaults-file=/etc/my.cnf --user=MySQL &
8) To view the version as follows:
- MySQL> select version ();
- +-----------------------------------------------------------+
- | Version () |
- +-----------------------------------------------------------+
- | 5.5.20-enterprise-commercial-advanced-log |
- +-----------------------------------------------------------+
- 1 row in Set (0.00 sec)
- MySQL> select @ @innodb_version;
- +----------------------------+
- | @ @innodb_version |
- +----------------------------+
- | 1.1.8 |
- +----------------------------+
- 1 row in Set (0.00 sec)
This completes the upgrade process.
During the upgrade process, there is an issue to be aware of, which was encountered by the author prior to installation. RHEL5.3 a system crash occurred while installing MySQL5.5 (1-24), when the environment was: the system is rhel5.3,64 bit, XFS partition, MySQL5.5.20 binary version.
When the system crashes, the author uses Delldrac remote management card capture screenshot 1-25.
As you can see, the XFS file system has errors when reading and writing. This problem occurs because the RHEL5.3 system kernel does not bring the XFS file system, it is supported by patching to the kernel, and later the system is upgraded to RHEL5.5, the system is normal, and no freezing situation occurs.
Attention
RHEL5.5 version, the kernel supports XFS file systems.
Upgrade with Mysql_upgrade upgrade Authorization form