MySQL社区

标题: MySQL升级5.1.43->5.5.8注意细则 [打印本页]

作者: kider    时间: 2012-4-19 17:17
标题: MySQL升级5.1.43->5.5.8注意细则
来自:网摘

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识别并应用。

作者: 蜜桃のx    时间: 2012-4-23 11:49
谢谢楼主分享的。
作者: Lǐn-credible    时间: 2013-2-20 09:05
{:soso_e100:}




欢迎光临 MySQL社区 (http://www.mysqlpub.com/) Powered by Discuz! X3.2