随笔分类 - mysql
摘要:测试准备1、安装xtrabackup工具以下测试安装xtrabackup备份恢复工具的二进制包,进行测试。安装的路径为mysql安装路径,本次测试mysql的安装路径为:/home/q/percona-server/。tar -xzf percona-xtraback-2.0.0-x86-64.ta...
阅读全文
摘要:如何快速比较查询结果是否一致如何快速比较查询结果是否一致(system@localhost) [tom]> pager md5sum -PAGER set to 'md5sum -'(system@localhost) [tom]> select * from users;6004a48a825ef...
阅读全文
摘要:mysql-5.5.37-linux2.6-x86_64.tar.gz/application/mysql/bin/mysqld_safe --defaults-file=/data/data0/mysql/3306/my.cnf & 总是启动不成功报错/usr/local/mysql不存在 ???...
阅读全文
摘要:http://bugs.mysql.com/search.php?search_for=&status=Active&severity=&limit=10&order_by=&cmd=display&direction=ASC&os=0&phpver=&bug_age=0
阅读全文
摘要:MySQL常见故障处理手册http://www.housong.net/mysql-normal-trouble-shooting.html一、性能故障1. 数据库主机LOAD飙高(1)一般导致MySQL服务器LOAD突然飙高,可能的五种情况: – 全表扫描的SQL语句; – SELECT操作语句的执行计划走错; – 存在UPDATE/DELETE 语句没有索引可选择,而导致堵塞其他SQL语句的执行; – 存在修改表结构或OPTIMIZE 语句执行; – 大数据量的导入或导出,尤其数据库的逻辑备份操作; – 业务量大到超过服务器处理能力(我们大家都高度关注业务发展,以及公司业务特点, – 还有
阅读全文
摘要:http://www.housong.net/mysql-error-code-list.html1005:创建表失败1006:创建数据库失败1007:数据库已存在,创建数据库失败1008:数据库不存在,删除数据库失败1009:不能删除数据库文件导致删除数据库失败1010:不能删除数据目录导致删除数据库失败1011:删除数据库文件失败1012:不能读取系统表中的记录1020:记录已被其他用户修改1021:硬盘剩余空间不足,请加大硬盘可用空间1022:关键字重复,更改记录失败1023:关闭时发生错误1024:读文件错误1025:更改名字时发生错误1026:写文件错误1032:记录不存在1036:
阅读全文
摘要:http://369258.blog.51cto.com/359258/1342937ySQL优化 my.ini 配置说明2013-12-19 19:17:46标签:mysqlmy.ini[mysqld]port = 3306serverid = 1socket = /tmp/mysql.sockskip-name-resolve#禁止MySQL对外部连接进行DNS解析,使用这一选项可以消除MySQL进行DNS解析的时间。但需要注意,如果开启该选项,则所有远程主机连接授权 都要使用IP地址方式,否则MySQL将无法正常处理连接请求!注:如果用winform连接mysql,加入此句速度会有很大的
阅读全文
摘要:mysql配置文件my.cnf详解2009-09-24 14:36:49分类:Mysql/postgreSQL调整MySQL运行参数,修改/etc/my.cnf文件调整mysql运行参数重启MySQL后生效,在MySQL4版本以后,一部分内部变量可以在MySQL运行时设置,不过重启MySQL就失效了。mysqld程序--目录和文件basedir = path # 使用给定目录作为根目录(安装目录)。datadir = path # 从给定目录读取数据库文件。pid-file = filename # 为mysqld程序指定一个存放进程ID的文件(仅适用于UNIX/Linux系统);[mysql
阅读全文
摘要:http://dinglin.iteye.com/blog/1982176 背景 上一篇博文(链接)介绍了count distinct的一个bug。解决完以后发现客户的SQL语句仍然返回错误结果(0), 再查原因,发现了另外一个bug。也就是说,这个SQL语句触发了两个bug -_-这里只说第二个,将问题简化后复现如下,影响已知的所有版本 。drop table if exists tb;set tmp_table_size=1024;create table tb(id int auto_increment primary key, v varchar(32))engine=myisam c
阅读全文
摘要:Description In mysql-connector-java-5.1.27, the charset utf8mb4 is supported. But the steps and result bellow looks buggy.1、 set character_set_server=gbk in my.cnf2、 start mysql3、 execute set global character_set_server=utfmb4;4、 insert a data with utf8mb4 charactersResult: error data inserted.Analy
阅读全文
摘要:mysql> select date_format('2013-11-19','Y-m-d') > timediff('2013-11-19', '2013-11-20'); ERROR 1267 (HY000): Illegal mix of collations (utf8_general_ci,COERCIBLE) and (latin1_swedish_ci,NUMERIC) for operation '>'乍一看挺莫名其妙的,查了下手册,发现有这么一段:The language use
阅读全文
摘要:背景 客户报告了一个count(distinct)语句返回结果错误,实际结果存在值,但是用count(distinct)统计后返回的是0。 将问题简化后复现如下,影响已知的所有版本。drop table if exists tb;set tmp_table_size=1024;create table tb(id int auto_increment primary key, v varchar(32)) charset=gbk;insert into tb(v) values("aaa");insert into tb(v) (select v from tb);inse
阅读全文
摘要:Last packet sent to the server was 0 ms ago.com.alibaba.druid.pool.GetConnectionTimeoutException: loopWaitCount 0, wait millis 60552, active 0使用droid出现上述问题后经分析发现1:用户名密码不正确,也报这个错2:用户权限不正确也报这个错3:访问地址不正确也报这个错 ?????4:重新设置地址,重新加正确的权限,正确的地址 常用一样很重要改写的droidUtils工具类 温大侠讲,可以是线程问题.. //------------------------
阅读全文
摘要:自己遇到转别人的http://blog.csdn.net/gumanren/article/details/8449794再用SQLYog进行10w用户数据sql导入的时候,出错,后查看日志找到错误代码为:MySQL 服务器已离线后经过google发现时mysql设置的问题.这个问题是因为MySql的默认max_allowed_packet过小所致,修改大一些即可max_allowed_packet = 100M另外,可以增加一下两个参数,来扩大相应时间interactive_timeout=28800000wait_timeout=28800000
阅读全文
摘要:InnoDB: Error: auto-extending data file ./ibdata1 is of a different sizedf磁盘空间不足
阅读全文
摘要:select * from user where xx=1 limit 10,10你需要有ORDER BY 字段。 然后需要 (xx, orderCol) 的复合索引,再使用select * from user a inner join (select id from user where xx=1 order by id limit 10,10) b using(id)select * from emp where deptno = 20 limit 900000,3;ysql> alter table emp add index(deptno,empno);uery OK, 0 ro
阅读全文
摘要:ERROR 1010 (HY000): Error dropping database (can't rmdir './demo/', errno: 17)[root@james ~]# ls -lh /data1/demototal 44K-rw-r--r-- 1 root root 42K Apr 26 13:05 a.txt在对应的目录存在非数据库文件, a.txt load文件删除不成功[root@james ~]# rm /data1/demo/a.txtrm: remove regular file `/data1/demo/a.txt'? ymys
阅读全文
摘要:问题:创建多个表空间添加记录数据会添加到哪个表空间中答:后一个drwx------ 2 mysql mysql 4.0K Apr 26 08:04 demo-rw-rw---- 1 mysql mysql 18M Apr 26 09:52 ibdata1-rw-rw---- 1 mysql mysql 10M Apr 26 09:23 ibdata2-rw-rw---- 1 mysql mysql 5.0M Apr 26 09:52 ib_logfile0-rw-rw---- 1 mysql mysql 5.0M Apr 26 09:52 ib_logfile1-rw-rw---- 1 mys
阅读全文
摘要:遇到问题:动态:添加表空间定义文件出错不能添加第2个文件innodb_data_file_path = /data1/ibdata1:10M:autoextend;/data1/ibdata2:1000M:autoextendInnoDB: Error: data file ./ibdata1 is of a different sizeInnoDB: 1152 pages (rounded down to MB)InnoDB: than specified in the .cnf file 640 pages!130426 8:46:08 InnoDB: Could not open or
阅读全文
摘要:将文本内容导入mysql数据库中导入语句加入字符集,否则乱码character set gbk;因为name列加了唯一索列,加这个是为避免重复数据插入报错ignore into table把相同的先删除掉replace into table[linux]这里关键load data infile '/tmp/t0.txt' ignore into table t0 character set gbk fields terminated by ',' enclosed by '"' lines terminated by '\n
阅读全文
浙公网安备 33010602011771号