max_connections
<div style="background-color:#FFFFFF;font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;">当连接数超出了max_connections的时候,后台日志文件不会报错</div><div style="background-color:#FFFFFF;font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;">连接的时...
mysqldump dump-slave
查看从库的状态,发现从库的sql_thread进程会自动停止,停止之后 又会自动开启,没有人操作这个库<br />苦苦找不到原因。<br />通过show full processlist查看进程时,发现有一个备份的进程在执行。<br />找到备份的脚本,加上crontab里的定时任务,发现原来是这个备份引起的。<br />备份的时候,使用了dump-slave选项...
Last_SQL_Error: Could not execute Update_rows event
<div style="background-color:#FFFFFF;font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;"><span style="background-color:inherit;line-height:1.5;">踩吭:</span></div><div style="background-color:#FFFFFF;font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;...
The incident LOST_EVENTS occured on the master
<span style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;background-color:#FFFFFF;"> Last_SQL_Error: The incident LOST_EVENTS occured on the master. Message: error writing to the binary log</span><div style="background-color:#FFFFFF;font-family:微软雅黑;font-size:14...
mysql event对主从的影响
<div style="background-color:#FFFFFF;font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;"><span style="line-height:1.5;">event_scheduler对主从的影响:</span><br style="background-color:inherit;" /></div><div style="background-color:#FFFFFF;font-family:微软雅黑;font-size:14px...
对于innodb_file_per_table=off时,innodb引擎,误删除表的恢复
对于innodb_file_per_table=off时,innodb引擎,误删除表的恢复。<br /><br /><br />场景模拟:<br />mysql> show databases; <br />+--------------------+ <br />| Database | <br />+--------------------+ <br />| information_schema | <br />| d1 | <br />| mysql | ...
mysql数据恢复
书接上文,把未删除表数据也恢复出来:
未删除的表结构从ibdata1文件进行恢复
上节说到对于删除的表结构进行恢复,这次讲对于未删除的表结构进行恢复:
mysql 还原表的定义语句
还原表的定义语句:如果表被删除,可以使用下面的方法 找到表的定义语句:1 环境准备: mysql> create database db_song; Query OK, 1 row affected (0.24 sec) mysql> use db_song; Database changed mysql> create table t1(id int); Query OK, 0 rows affected (0.01 sec)...
mysqldump备份时使用single-transaction会不会加锁???
经常被讨论的一个话题:mysqldump备份时加single-transaction会不会加锁???通过根踪可以看到:8 Connect root@localhost on 8 Query /*!40100 SET @@SQL_MODE='' */ 8 Query /*!40103 SET TIME_ZONE='+00:00' */ 8 Query FLUSH /*!40101 LOCAL */ TABLES 8 Query ...
[ERROR] Slave I/O: Replication event checksum Error_code: 1743
[ERROR] Slave I/O: Replication event checksum verification failed while reading from network. Error_code: 1743的模拟:目前主从状态是正常的:mysql> show slave status\G*************************** 1. row ***************************  ...
read_only的影响范围
今天看到语句set global read_only=on; 以为这条语句只对设置变量之后的连接才有效果。 因为记得set global 就是只对本设置之后再次连接到数据库上的连接才有效,对于已经存在的连接,没有效果。 查看了一下文档: If you change a global system variable, the value is remembered and used for new ...
查询缓存(query_cache)的影响
查询缓存(query_cache)的影响:对读和写都有影响,因为1 读的时候要查看结果集是不是在query cache中,如果不在并且这个结果可以被缓存 要放入到 query cache中2 写入到某个表的时候,需要把这个表相关的query cache中记录都设为无效,如果缓存大或碎片多,那么会浪费时间查询缓存操作是一个排他操作,这个...
mysql绕过行触发器,实现语句触发器
mysql只有基于行的trigger,对于before trigger可以通过下面的方法 实现基于语句的trigger(只执行一次):因为基于before trigger 除了处理的第一条记录,别的row_count()都会返回1,但这并非真正意义上的单条sql语句的触发器。这可能是mysql 的一个bug, 有可能以后的版本中会没有这种情况,所以,用之前请先测试...
innodb索引的统计信息不存在物理存储上
innodb索引的统计信息不存在物理存储上innodb不在盘上存储索引的统计信息, 统计信息可以在information_schema.STATISTICS表中看到, 查看这个表的定义:mysql> show create table information_schema.STATISTICS;+------------+----------------------------------------------------------------------...
官方mysql中查看索引是否被使用到
官方mysql中查看索引是否被使用到:在percona版本或marida中可以通过 information_schea.index_statistics查看得到,在官方版本中如何查看呢?select object_type,object_schema,object_name,index_name,count_star,count_read,COUNT_FETCH from performance_schema.table_io_waits_summary_by_inde...
.ibd文件坏了怎么办?
.ibd文件坏了怎么办?接.frm文件坏了怎么办?http://blog.sina.com.cn/s/blog_5037eacb0102vlsy.html在5.6版本中使用vi修改了t3.ibd文件后,重新启动库 150527 18:03:44 mysqld_safe Starting mysqld daemon with databases from /data 2015-05-27 18:03:44 0 [Warning] Using unique option prefi...
通过连接的方式把数据文件放在别的地方
上篇写到通过create table data direcotry把数据文件放在别的地方。http://blog.itpub.net/25099483/viewspace-1662886/对于建立好的表同样以通过连接的方式把数据文件放在别的地方:mysql> use test;Reading table information for completion of table and column namesYou can turn off this feat...
建立用户之后,有了不该有的权限
mysql> grant select on aaa.t1 to 'user_a'@'%' identified by '123456'; Query OK, 0 rows affected (0.33 sec) [mysql@localhost ~]$ mysql -u user_a -p -h 127.0.0.1 Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2...
mysql中delete fro mysql.user where XX和drop user的不同
网友反映一个问题:删除用户之后,再建立一个一样的用户,原来用户的权限还在。为什么?让他重现过程,根据他的过程我在本机也可以重现:mysql> show databases; +--------------------+| Database |+--------------------+| information_schem...