
原文地址:http://www.mysqlperformanceblog.com/2012/02/25/introducing-new-type-of-benchmark/
一篇写的很好的文章,让测试更加接近现实。
Traditionally the most benchmarks are focusing on throughput. We all get used to that, and in fact in our benchmarks, sysbench and tpcc-mysql, the final result is also represents the throughp继续阅读
innodb long column在不同的file format下的存储:
innodb_file_format=Antelope,ROW_FORMAT=COMPACT或者REDUNDANT时,保存前768个字节,剩下的会保存在overflow page中。
innodb_file_format=Barracuda,table is created with ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED, long column values are stored fully off-page, and the clustered index rec继续阅读
跟同事讨论latin1与中文的关系,调查了之后将结果总结如下:
不同的字符集编码了不同的字符,latin1中包含有191个可打印字符,其余是控制字符或者扩展的欧洲特殊字符;不包含中文字符。
之所以可以在latin1中保存和显示中文字符请看下面的示例以及说明:
latin1和ascii都可以存储中文(ascii就不列举)
`name` VARCHAR(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SET names latin1;
INSERT INT继续阅读
一、MySQL正在运行
mysql> status
————–
mysql Ver 14.14 Distrib 5.5.18, for Linux (x86_64) using readline 5.1
mysql> select version();
+————+
| version() |
+————+
| 5.5.12-log |
+————+
1 row in set 继续阅读
一、故障原因
使用trigger在特定的场景(场景描述见Bug重现以及原因分析)下触发了mysql的bug,官方已经确认bug还没有修复,目前5.1以上版本都存在。
Bug地址http://bugs.mysql.com/bug.php?id=53079
二、解决方案
1.将binlog_format修改为mixed或者row-based(可以在线修改)。
2.从应用角度分析,摒弃trigger这种实现方式。
三、Bug重现以及原因分析
下面是从bug中摘取的,描述的很清晰,我这里就不做翻译了,已经进行了测试了和bug描述的一致。
Description:
When there is an UP继续阅读
线上遇到的错误:
主库5.1版本执行下面类似的语句
mysql> update test set age=greatest(0,age-1) where id=1;
从库5.5版本复制出错:
mysql> update test set age=greatest(0,age-1) where id=1;
原因:
Mysql5.5下sql_mode为空时,两个数想减,当其中一个为unsigned时,如果结果为负数,则会出现error;sql_mode修改为NO_UNSIGNED_SUBTRACTION,则不会出现error,如下所示:
mysql> SET sql_mode = '';
Quer继续阅读
mysql跳过大量replication错误的几种方法(错误大家都不想见到,但是见到了也得想办法处理):
1,使用pt-slave-restart脚本
地址:http://www.percona.com/doc/percona-toolkit/pt-slave-restart.html
推荐使用这种方法,有诸多优点:快速,可以使用error-numbers选项跳过指定的error code
2,使用set sql_slave_skip_counter
使用watch -n 1 “mysql -hxxx -uxx -pxx -e’set global sql_slave_skip_c继续阅读
安装之前需要先安装
①MySQL-devel-VERSION.i386.rpm。The libraries and include files that are needed if you want to compile other MySQL clients, such as the Perl modules。如果不安装会出现“EnvironmentError: mysql_config not found”。
②MySQL-shared-VERSION.i386.rpm。This package contains the shared libraries (libmysqlclient.s继续阅读
mysql5.5中create tempory table with innodb engine会造成mysqld crash掉
mysql@>create temporary table test1(id int) engine=innodb;
Query OK, 0 rows affected (0.00 sec)
mysql@>show create table test1;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect…
Connection id: 1
继续阅读
近期评论