1. 阅读MySQL 5.6 release notes 和change list 以便查看MySQL 5.6 的新特性和兼容性
根据change list 更改相应的配置和SQL语法
1) Configuration Changes
2) SQL Changes
3) Server Changes

2. 备份MySQL 5.5 所有数据用mysqldump

[root@mysqlnode1 ~]# mysqldump -uroot --all-databases --routines --events > all.sql

3. 停掉数据库

[root@mysqlnode1 ~]# /etc/init.d/mysql stop
Shutting down MySQL.                                       [  OK  ]
[root@mysqlnode1 ~]#

4. 更改MySQL 5.5 二进制程序目录名字,以便升级失败快速回退

[root@mysqlnode1 local]# mv  mysql  mysql5.5.32

5. 解压MySQL 5.6 二进制程序到对应的目录

[root@mysqlnode1 ~]# tar -zxvf mysql-advanced-5.6.14-linux2.6-x86_64.tar.gz
[root@mysqlnode1 ~]# mv mysql-advanced-5.6.14-linux2.6-x86_64 /usr/local/mysql

6. 如果MySQL 5.5 配置文件和MySQL 5.6配置文件不兼容,修改对应的配置项

[mysqld]
innodb_file_per_table=0

7. 开启数据库

[root@mysqlnode1 local]# /etc/init.d/mysql start
Starting MySQL............                                 [  OK  ]
[root@mysqlnode1 local]# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.14-enterprise-commercial-advanced MySQL Enterprise Server - Advanced Edition (Commercial)

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

8. 运行mysql_upgrade 其实这个命令包含一下三个命令:
# mysqlcheck –check-upgrade –all-databases –auto-repair
# mysql_fix_privilege_tables
# mysqlcheck –all-databases –check-upgrade –fix-db-names -fix-table-names

[root@mysqlnode1 local]# mysql_upgrade 
Looking for 'mysql' as: mysql
Looking for 'mysqlcheck' as: mysqlcheck
Running 'mysqlcheck with default connection arguments
Running 'mysqlcheck with default connection arguments
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.proxies_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
Running 'mysql_fix_privilege_tables'...
Running 'mysqlcheck with default connection arguments
Running 'mysqlcheck with default connection arguments
OK
[root@mysqlnode1 local]#

9. 检查是否升级成功

[root@mysqlnode1 local]# mysql –uroot –p
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 11
Server version: 5.6.14-enterprise-commercial-advanced MySQL Enterprise Server - Advanced Edition (Commercial)

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> show tables;
+---------------------------+
| Tables_in_mysql           |
+---------------------------+
| columns_priv              |
| db                        |
| event                     |
| func                      |
| general_log               |
| help_category             |
| help_keyword              |
| help_relation             |
| help_topic                |
| host                      |
| innodb_index_stats        |
| innodb_table_stats        |
| ndb_binlog_index          |
| plugin                    |
| proc                      |
| procs_priv                |
| proxies_priv              |
| servers                   |
| slave_master_info         |
| slave_relay_log_info      |
| slave_worker_info         |
| slow_log                  |
| tables_priv               |
| time_zone                 |
| time_zone_leap_second     |
| time_zone_name            |
| time_zone_transition      |
| time_zone_transition_type |
| user                      |
+---------------------------+
29 rows in set (0.00 sec)

mysql>
Trackback

no comment untill now

Add your comment now

切换到手机版