23天学完mysql系统变量(一)
来源:互联网 发布:无线网卡不显示网络 编辑:程序博客网 时间:2024/06/10 00:37
一直以来我只关注mysql的比较重要的系统变量,这是不够的,所以我决定从今天起了解全部的系统变量,我想这是作为一个专业DBA应该具备的知识。
从A到W,每天学习以一个字母开头的变量。
今天就从A开始,以A开头的变量有四个,btw,我用的版本是5.5.19
auto_increment_increment
auto_increment_offset
autocommit
automatic_sp_privileges
autocommit
automatic_sp_privileges
1.auto_increment_increment 和 auto_increment_offset
这两个变量放到一起学习,因为他们都跟主-主复制有关,用来控制AUTO_INCREMENT列的。
默认值:都是1。
注意:
只支持NDB存储引擎
auto_increment_increment : 控制相邻两行的间隔值。
auto_increment_offset : 决定auto_increment的起始值
例1:
mysql> show global variables like 'auto_increment%';
+--------------------------------------+---------+
| Variable_name | Value |
+--------------------------------------+---------+
| auto_increment_increment | 1 |
| auto_increment_offset | 1 |
+--------------------------------------+---------+
2 rows in set (0.00 sec)
+--------------------------------------+---------+
| Variable_name | Value |
+--------------------------------------+---------+
| auto_increment_increment | 1 |
| auto_increment_offset | 1 |
+--------------------------------------+---------+
2 rows in set (0.00 sec)
当前设置,起始值和间隔值都是默认值1。
结果就会是这样:
+-----+| id |+-----+| 1 || 2 || 3 || 4 |+-----+
例2:
mysql> show global variables like 'auto_increment%';
+--------------------------------------+---------+
| Variable_name | Value |
+--------------------------------------+---------+
| auto_increment_increment | 10 |
| auto_increment_offset | 5 |
+--------------------------------------+---------+
+--------------------------------------+---------+
| Variable_name | Value |
+--------------------------------------+---------+
| auto_increment_increment | 10 |
| auto_increment_offset | 5 |
+--------------------------------------+---------+
当前设置起始值为5,间隔为10。
结果就会是这样:
+-----+| id |+-----+| 5 || 15 || 25 || 35 |+-----+
2.autocommit
默认值1,事务自动提交,这个没什么好说的。
3.automatic_sp_privileges
默认值1.这个变量跟存储例程有关。当创建一个存储例程时,mysql会自动授予创建存储例程的用户ALTER_ROUTINE和EXECUTE的权限。
ok,今天的学习任务完成。
- 23天学完mysql系统变量(一)
- 23天学完mysql系统变量(二)
- 23天学完mysql系统变量(三)
- 23天学完mysql系统变量(四)
- 23天学完mysql系统变量(五)
- 23天学完mysql系统变量(六)
- 23天学完mysql系统变量(七)
- 23天学完mysql系统变量(八)
- 23天学完mysql系统变量(九)
- 23天学完mysql系统变量(十)
- mysql变量(用户+系统)
- mysql系统变量(上)
- mysql系统变量(下)
- Mysql源代码阅读笔记(一) 系统变量和系统状态变量
- mysql系统变量详解
- MySQL系统变量
- mysql系统变量
- MySQL标准变量、临时变量、系统变量
- fedora 14 root不能登陆修改方法
- iBATIS 3 内的新特性
- sql server 18456
- Microsoft SQL Server 2005中的外键表与主键表
- 360浏览器收藏夹导出问题终极解决方案
- 23天学完mysql系统变量(一)
- 有限状态机的嵌入式Linux按键驱动设计
- shell脚本检查Oracle DG备库是否已经应用归档
- 《Windows程序设计》之HEXCALC
- Vim 配置详解
- i2c驱动开发接口
- DG检测归档是否传输到备库
- 去掉vs中的console的黑窗口
- Oracle 11g 数据库备份还原