112012
mysql5.6新功能通过flush table with read lock时将meta-data记录到一个单独的文件中,从而使得可以将ibd文件copy到别处进行import,这样可以使用xtrabackup的备份的表可以进行单表还原,但是还得先把xtrabackup备份启动起来生成cfg文件;还是比较麻烦,Percona可以直接import(可以从官方的innodb引擎备份的文件中进行import),注意Percona这个功能(通过参数innodb_import_table_from_xtrabackup.
控制)默认是关闭的,不过是dynamic的。
http://www.perco继续阅读
Introducing new type of benchmark(简略翻译)

原文地址: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继续阅读

MySQL中latin1与中文

Posted by admin at 下午 5:27 MySQL No Responses » Tagged with:
302012

跟同事讨论latin1与中文的关系,调查了之后将结果总结如下:
不同的字符集编码了不同的字符,latin1中包含有191个可打印字符,其余是控制字符或者扩展的欧洲特殊字符;不包含中文字符。

之所以可以在latin1中保存和显示中文字符请看下面的示例以及说明:
latin1和ascii都可以存储中文(ascii就不列举)

CREATE TABLE `user` (
`name` VARCHAR(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SET names latin1;
INSERT INT继续阅读
十二 282011

一、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 继续阅读

十二 122011

一、故障原因

使用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继续阅读

262011

安装之前需要先安装
①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
继续阅读

© 2012 TheMySQL Suffusion theme by Sayontan Sinha
普人特福的博客cnzz&51la for wordpress,cnzz for wordpress,51la for wordpress