MySQL社区

 找回密码
 注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

搜索
查看: 6508|回复: 3
打印 上一主题 下一主题

[升级] MySQL升级5.1.43->5.5.8注意细则

[复制链接]
跳转到指定楼层
1#
发表于 2012-4-19 17:17:17 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
来自:网摘

5.1.43升级到5.5.8升级过程中需要注意以下问题:
1.环境变量的更改(PATH=$PATHHOME/bin:/usr/local/mysql5.5/bin)
2.使用innodb_read_io_threadsinnodb_write_io_threads替代innodb_file_io_threads
3.character-set-server = utf8替代default-character-set = utf8 ,
4.有关复制参数的注释(升级结束后重新启动mysql服务安装复制模块)
5.配置文件中basedir指向更改
6.default_table_type = MyISAM 的更改
7.移除参数myisam_max_extra_sort_file_size
升级步骤如下:
1.mysql服务,如有复制,等slaverelay log执行完毕。
2.切换到mysql5.5主目录,执行:./bin/mysqld --defaults-file=/etc/my.cnf --skip-grant-tables &
3.接着执行更新程序./bin/mysql_upgrade
4.再次停mysql服务
5.启动mysql服务./bin/mysqld_safe  --defaults-file=/etc/my.cnf --user=mysql &(在重新启动mysql服务时,我们可以定制一些我们需要的mysql5.5新特性,如innodb_buffer_pool_instances,innodb_io_capacity,performance_schema等)

复制功能测试:
1.安装复制模块:install plugin rpl_semi_sync_master soname 'semisync_master.so';
2.删除relay-log.info和mysql-relay-bin.index文件。不然在执行start slave时,报Could not initialize master info structure; more   error messages can be found in the MySQL error log;

       测试如下:
                      testrep表在升级停slave时,主从上数据为:
                                  select * from rep;
                                  +------+------+
                                  | id   | name |
                                  +------+------+
                                  |    1 | qqq  |
                                  |    2 | www  |
                                  |    3 | eee  |
                                  +------+------+

Master 信息如下:
File: mysql-bin.000001
Position: 415

Slave status信息如下:
Master_Host: 192.168.99.70
Master_User: repl
Master_Port: 3307
Connect_Retry: 30
Master_Log_File: mysql-bin.000001
Read_Master_Log_Pos: 415
Relay_Log_File: relay-bin.000005
Relay_Log_Pos: 457
Relay_Master_Log_File: mysql-bin.000001
Slave_IO_Running: Yes
Slave_SQL_Running: Yes

slave升级。同时往master test.rep里面执行以下操作:
mysql> insert into rep values(4,rrr),(5,ttt),(6,yyy);
mysql> update rep set name='repl' where id=5;
mysql> delete from rep where id=1;

Mster 信息如下:
File: mysql-bin.000001
            Position:978

rep表数据为:
select * from rep;
+------+------+
| id   | name |
+------+------+
|    2 | www  |
|    3 | eee  |
|    4 | rrr  |
|    5 | repl |
|    6 | yyy  |
+------+------+

开启
slaveSlave status信息如下:
Master_Log_File: mysql-bin.000001
Read_Master_Log_Pos: 978
Relay_Log_File: mysql-relay-bin.000002
Relay_Log_Pos: 815
  Relay_Master_Log_File: mysql-bin.000001
  Slave_IO_Running: Yes
Slave_SQL_Running: Yes

查看
Slaverep表数据:
select * from rep;
+------+------+
| id   | name |
+------+------+
|    2 | www  |
|    3 | eee  |
|    4 | rrr  |
|    5 | repl |
|    6 | yyy  |
+------+------+

查看
SlaveMySQLInnoDB引擎信息:
select version();
+------------------------------------------+
| version()                                |
+------------------------------------------+
| 5.5.8-enterprise-commercial-advanced-log |
+------------------------------------------+
SELECT @@innodb_version;
+------------------+
| @@innodb_version |
+------------------+
| 1.1.4            |
+------------------+

MySQL 5.1.43后期产生的binlog成功被MySQL 5.5.8识别并应用。

本帖被以下淘专辑推荐:

分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友 微信微信
收藏收藏 分享淘帖1 顶 踩
2#
发表于 2012-4-23 11:49:18 | 只看该作者
谢谢楼主分享的。
3#
发表于 2013-2-20 09:05:43 | 只看该作者
{:soso_e100:}
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|申请友链|小黑屋|Archiver|手机版|MySQL社区 ( 京ICP备07012489号   
联系人:周生; 联系电话:13911732319

GMT+8, 2024-4-30 15:08 , Processed in 0.071943 second(s), 28 queries , Gzip On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表