mysql basic api_Mysql Basic - 随笔分类 - Still water run deep - 博客园

随笔分类 - Mysql Basic

摘要:mysql序列(这里只谈innodb引擎): In this lock mode, all “INSERT-like” statements obtain a special table-level AUTO-INC lock for inserts into tables with AUTO_IN

阅读全文

posted @ 2016-06-07 18:49

Still water run deep

阅读(1439)

评论(0)

推荐(0) 编辑

摘要:前言:MySQL进行主主复制或主从复制的时候会在配置文件制定的目录下面产生相应的relay log,本文档总结这些相关参数的定义及解释。 1、什么是relay log The relay log, like the binary log, consists of a set of numbered

阅读全文

posted @ 2016-05-11 14:18

Still water run deep

阅读(2010)

评论(0)

推荐(0) 编辑

摘要:关闭正在运行的 MySQL : [root@www.woai.it ~]# service mysql stop 运行 [root@www.woai.it ~]# mysqld_safe --skip-grant-tables & 为了安全可以这样禁止远程连接: [root@www.woai.it

阅读全文

posted @ 2016-05-04 15:56

Still water run deep

阅读(10054)

评论(0)

推荐(0) 编辑

摘要:Recently I had an interesting surprise with concurrent inserts into a MyISAM table. The inserts were not happening concurrently with SELECT statements...

阅读全文

posted @ 2015-01-05 00:56

Still water run deep

阅读(177)

评论(0)

推荐(0) 编辑

摘要:From command line we have the entire MySQL server on hands (if we have privileges too of course) but we don’t have a overall overview, at this point t...

阅读全文

posted @ 2014-12-12 03:03

Still water run deep

阅读(175)

评论(0)

推荐(0) 编辑

摘要:SHOW TABLE STATUSworks likesSHOW TABLES, but provides a lot of information about each non-TEMPORARYtable. You can also get this list using themysqlsho...

阅读全文

posted @ 2014-12-12 02:59

Still water run deep

阅读(335)

评论(0)

推荐(0) 编辑

摘要:Wheninnodb_strict_modeisON,InnoDBreturns errors rather than warnings for certain conditions. The default value isOFF.Strict modehelps guard against ignored typos and syntax errors in SQL, or other unintended consequences of various combinations of operational modes and SQL statements. Wheninnodb_str

阅读全文

posted @ 2014-04-11 21:10

Still water run deep

阅读(1278)

评论(0)

推荐(0) 编辑

摘要:This function returns a string result with the concatenated non-NULLvalues from a group. It returnsNULLif there are no non-NULLvalues. The full syntax is as follows:GROUP_CONCAT([DISTINCT] expr [,expr ...] [ORDER BY {unsigned_integer | col_name | expr} [ASC | DESC] [,col_...

阅读全文

posted @ 2014-03-02 14:04

Still water run deep

阅读(312)

评论(0)

推荐(0) 编辑

摘要:Q:innodb log file与binlog的区别在哪里?有人说1。mysql的innodb引擎实际上是包装了inno base存储引擎。而innodb log file是由 inno base自身带来。 而mysql自身因为还有myisam等存储引擎,需要设置自己的日志文件来用于所有的存储引擎记录日志信 息,因此增加了binlog。从某种意义上说binlog对于innodb存储引擎来说与innodb log是有些重复的。2。binlog应该是mysql真正的redo日志A:1. binlog是MySQL Server层记录的日志, redo log是InnoDB存储引擎层的日志。...

阅读全文

posted @ 2014-02-25 21:56

Still water run deep

阅读(515)

评论(0)

推荐(0) 编辑

摘要:今天丁原问我mysql执行计划中的key_len是怎么计算得到的,当时还没有注意,在高性能的那本书讲到过这个值的计算,但是自己看执行计划的时候一直都没有太在意这个值,更不用说深讨这个值的计算了:ken_len表示索引使用的字节数,根据这个值,就可以判断索引使用情况,特别是在组合索引的时候,判断所有的索引字段都被查询用到。在查看官方文档的时候,也没有发现详细的key_len的计算介绍,后来做了一些测试,在咨询了丁奇关于变长数据类型的值计算的时候,突然想到innodb 行的格式,在这里的计算中有点类似,总结一下需要考虑到以下一些情况:(1).索引字段的附加信息:可以分为变长和定长数据类型讨论,当索

阅读全文

posted @ 2014-02-25 21:38

Still water run deep

阅读(168)

评论(0)

推荐(0) 编辑

摘要:The total cost of the last compiled query as computed by the query optimizer. This is useful for comparing the cost of different query plans for the same query. The default value of 0 means that no query has been compiled yet. The default value is 0.Last_query_costhas session scope.TheLast_query_cos

阅读全文

posted @ 2014-02-24 21:52

Still water run deep

阅读(666)

评论(0)

推荐(0) 编辑

摘要:Explain语法EXPLAIN SELECT ……变体:1. EXPLAIN EXTENDED SELECT ……将执行计划“反编译”成SELECT语句,运行SHOW WARNINGS 可得到被MySQL优化器优化后的查询语句 2. EXPLAIN PARTITIONS SELECT ……用于分区表的EXPLAIN执行计划包含的信息id包含一组数字,表示查询中执行select子句或操作表的顺序id相同,执行顺序由上至下如果是子查询,id的序号会递增,id值越大优先级越高,越先被执行id如果相同,可以认为是一组,从上往下顺序执行;在所有组中,id值越大,优先级越高,越先执行select_ty.

阅读全文

posted @ 2014-02-21 23:16

Still water run deep

阅读(250)

评论(0)

推荐(0) 编辑

摘要:今天在写一个Perl脚本,想自动化查找出MySQL数据库中可能无效的索引,于是根据朝阳的书上提到的一些规则,我来设计了一些判断方法,其中发现某个我想要的值就是SHOW INDEX FROM table里的Cardinality,于是查了下它的含义以验证我的想法。MySQL中SHOW INDEX FROM table 会有以下结果列| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comme

阅读全文

posted @ 2014-02-19 22:56

Still water run deep

阅读(2604)

评论(0)

推荐(0) 编辑

摘要:One command, which few people realize exists isSHOW OPEN TABLES– it allows you to examine what tables do you have open right now:1 mysql> show open tables from test;2 +----------+-------+--------+-------------+3 | Database | Table | In_use | Name_locked |4 +----------+-------+--------+-----------

阅读全文

posted @ 2014-02-18 20:52

Still water run deep

阅读(249)

评论(0)

推荐(0) 编辑

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值