- 浏览: 59954 次
文章分类
最新评论
-
bo_hai:
再补充点东西,修改mysql的默认字符集:
vim /etc/ ...
Redhat Linux 5.x上安装mysql 5.6.10 -
bo_hai:
引用cp support-files/my-default.c ...
Redhat Linux 5.x上安装mysql 5.6.10 -
wangxiang243:
...
Redhat Linux 5.x上安装mysql 5.6.10
binlog-format可以取值: STATEMENT (default),ROW,MIXED。必须有SUPER才可以更改。不推荐replication正在进行时,修改binlog-format值。
binlog-do-db(binlog-ignore-db、replicate-do-db、replicate-ignore-db)对于多个数据库,必须用多行。因为数据库名字可以包含逗号,所以用逗号分隔多个数据库名字,会被认为是一个包含了逗号的数据库的名字。
无论binlog-format是什么,象create table和alter table之类的语句,总是以statement的格式记录在二进制日志中的。
binlog-do-db(binlog-ignore-db、replicate-do-db、replicate-ignore-db)生效与binlog-format有关:
binlog-format为STATEMENT时,生效的数据库为default database。
binlog-format为ROW时,生效的为表的所在的数据,与default database无关。
log-slave-updates 是否记录复制的更新。当用于级联复制时,很有必要。而在双主模式中,应当取FALSE。
auto_increment_increment
auto_increment_offset
取值为: auto_increment_offset + N*auto_increment_increment
sync-binlog 取值为0时,由操作系统的文件系统决定何时同步二进制日志。大于0时,为N个commit group后,同步到二进制日志。取值为1,最安全,但性能较低。
slave-ignore-errors 忽略复制的错误。不建议取值为all。正常情况下,不应该会有错;如果出错,应当解决错误,而不是忽略错误。
log-error 日志记录文件,记录MySQL服务器启动、关闭等信息。Windows平台注意路径要用“/”分隔,而不是“\”。
log-output (522页)
日志的记录位置:FILE TABLE NONE
sync_binlog (default 0, page 1849)
If the value of this variable is greater than 0, the MySQL server synchronizes its binary log to disk (using
fdatasync()) after sync_binlog[2129]commit groups are written to the binary log. The default
value of sync_binlog[2129]is 0, which does no synchronizing to disk—in this case, the server relies
on the operating system to flush the binary log's contents from to time as for any other file. A value of 1
is the safest choice because in the event of a crash you lose at most one commit group from the binary
log. However, it is also the slowest choice (unless the disk has a battery-backed cache, which makes
synchronization very fast).
innodb_flush_log_at_timeout (default 1, page 1810)
Write and flush the logs every Nseconds. This setting has an effect only when
innodb_flush_log_at_trx_commit[1811]has a value of 2.
innodb_flush_log_at_trx_commit (default 1, page 1811)
Controls the balance between strict ACIDcompliance for commitoperations, and higher performance
that is possible when commit-related I/O operations are rearranged and done in batches. You can
achieve better performance by changing the default value, but then you can lose up to one second worth
of transactionsin a crash.
• The default value of 1 is required for full ACID compliance. With this value, the log bufferis written out
to the log fileat each transaction commit and the flushto disk operation is performed on the log file.
• With a value of 0, any mysqldprocess crash can erase the last second of transactions. The log buffer
is written out to the log file once per second and the flush to disk operation is performed on the log file,
but no writes are done at a transaction commit.
• With a value of 2, only an operating system crash or a power outage can erase the last second of
transactions. The log buffer is written out to the file at each commit, but the flush to disk operation
is not performed on it. Before MySQL 5.6.6, the flushing on the log file takes place once per
second. Note that the once-per-second flushing is not 100% guaranteed to happen every second,
due to process scheduling issues. As of MySQL 5.6.6, flushing frequency is is controlled by
innodb_flush_log_at_timeout[1810]instead.
• InnoDB's crash recoveryworks regardless of the value. Transactions are either applied entirely or
erased entirely.
For the greatest possible durability and consistency in a replication setup using InnoDBwith
transactions, use innodb_flush_log_at_trx_commit=1and sync_binlog=1in your master
server my.cnffile.
thread_cache_size (default 8 + (max_connections / 100), page 580)
How many threads the server should cache for reuse. When a client disconnects, the client's threads
are put in the cache if there are fewer than thread_cache_size[580]threads there. Requests
for threads are satisfied by reusing threads taken from the cache if possible, and only when the cache
is empty is a new thread created. This variable can be increased to improve performance if you
have a lot of new connections. Normally, this does not provide a notable performance improvement
if you have a good thread implementation. However, if your server sees hundreds of connections
per second you should normally set thread_cache_size[580]high enough so that most new
connections use cached threads. By examining the difference between the Connections[618]and
Threads_created[632]status variables, you can see how efficient the thread cache is. For details,
see Section 5.1.6, “Server Status Variables”.
The default value is based on the following formula, capped to a limit of 100:
8 + (max_connections / 100)
binlog-do-db(binlog-ignore-db、replicate-do-db、replicate-ignore-db)对于多个数据库,必须用多行。因为数据库名字可以包含逗号,所以用逗号分隔多个数据库名字,会被认为是一个包含了逗号的数据库的名字。
无论binlog-format是什么,象create table和alter table之类的语句,总是以statement的格式记录在二进制日志中的。
binlog-do-db(binlog-ignore-db、replicate-do-db、replicate-ignore-db)生效与binlog-format有关:
binlog-format为STATEMENT时,生效的数据库为default database。
binlog-format为ROW时,生效的为表的所在的数据,与default database无关。
log-slave-updates 是否记录复制的更新。当用于级联复制时,很有必要。而在双主模式中,应当取FALSE。
auto_increment_increment
auto_increment_offset
取值为: auto_increment_offset + N*auto_increment_increment
sync-binlog 取值为0时,由操作系统的文件系统决定何时同步二进制日志。大于0时,为N个commit group后,同步到二进制日志。取值为1,最安全,但性能较低。
slave-ignore-errors 忽略复制的错误。不建议取值为all。正常情况下,不应该会有错;如果出错,应当解决错误,而不是忽略错误。
log-error 日志记录文件,记录MySQL服务器启动、关闭等信息。Windows平台注意路径要用“/”分隔,而不是“\”。
log-output (522页)
日志的记录位置:FILE TABLE NONE
sync_binlog (default 0, page 1849)
If the value of this variable is greater than 0, the MySQL server synchronizes its binary log to disk (using
fdatasync()) after sync_binlog[2129]commit groups are written to the binary log. The default
value of sync_binlog[2129]is 0, which does no synchronizing to disk—in this case, the server relies
on the operating system to flush the binary log's contents from to time as for any other file. A value of 1
is the safest choice because in the event of a crash you lose at most one commit group from the binary
log. However, it is also the slowest choice (unless the disk has a battery-backed cache, which makes
synchronization very fast).
innodb_flush_log_at_timeout (default 1, page 1810)
Write and flush the logs every Nseconds. This setting has an effect only when
innodb_flush_log_at_trx_commit[1811]has a value of 2.
innodb_flush_log_at_trx_commit (default 1, page 1811)
Controls the balance between strict ACIDcompliance for commitoperations, and higher performance
that is possible when commit-related I/O operations are rearranged and done in batches. You can
achieve better performance by changing the default value, but then you can lose up to one second worth
of transactionsin a crash.
• The default value of 1 is required for full ACID compliance. With this value, the log bufferis written out
to the log fileat each transaction commit and the flushto disk operation is performed on the log file.
• With a value of 0, any mysqldprocess crash can erase the last second of transactions. The log buffer
is written out to the log file once per second and the flush to disk operation is performed on the log file,
but no writes are done at a transaction commit.
• With a value of 2, only an operating system crash or a power outage can erase the last second of
transactions. The log buffer is written out to the file at each commit, but the flush to disk operation
is not performed on it. Before MySQL 5.6.6, the flushing on the log file takes place once per
second. Note that the once-per-second flushing is not 100% guaranteed to happen every second,
due to process scheduling issues. As of MySQL 5.6.6, flushing frequency is is controlled by
innodb_flush_log_at_timeout[1810]instead.
• InnoDB's crash recoveryworks regardless of the value. Transactions are either applied entirely or
erased entirely.
For the greatest possible durability and consistency in a replication setup using InnoDBwith
transactions, use innodb_flush_log_at_trx_commit=1and sync_binlog=1in your master
server my.cnffile.
thread_cache_size (default 8 + (max_connections / 100), page 580)
How many threads the server should cache for reuse. When a client disconnects, the client's threads
are put in the cache if there are fewer than thread_cache_size[580]threads there. Requests
for threads are satisfied by reusing threads taken from the cache if possible, and only when the cache
is empty is a new thread created. This variable can be increased to improve performance if you
have a lot of new connections. Normally, this does not provide a notable performance improvement
if you have a good thread implementation. However, if your server sees hundreds of connections
per second you should normally set thread_cache_size[580]high enough so that most new
connections use cached threads. By examining the difference between the Connections[618]and
Threads_created[632]status variables, you can see how efficient the thread cache is. For details,
see Section 5.1.6, “Server Status Variables”.
The default value is based on the following formula, capped to a limit of 100:
8 + (max_connections / 100)
发表评论
-
MySQL5.6:快速预热Buffer_Pool缓冲池
2014-03-03 17:54 1943数据库的buffer pool中的数据重启后,会丢失。因此,再 ... -
用alter table添加索引与create index区别
2014-03-03 17:12 23821、alter table一次可以添加多个索引,create ... -
MySQL 5.6的密码验证插件
2014-03-03 15:36 2818运行时加载validate_password插件: my ... -
MySQL变量:local_infile
2014-02-28 11:31 4160local_infile服务器变量指示能否使用load dat ... -
mysqlbinlog
2013-12-23 16:54 1680mysqlbinlog 会解析日志,并生成BINLOG语句,可 ... -
mysqlfabric
2013-12-15 23:00 679MySQL Fabric: Presentations htt ... -
多粒度锁机制
2013-11-28 22:42 1103Introduction to Transaction Loc ... -
MySQL 5.6中备份及还原performance_schema配置
2013-11-27 09:35 2977一、setup.txt文件,用于备份performance_s ... -
Waiting for table metadata lock
2013-11-26 18:15 1302一个没提交的事务使用了A表, 另外一个session 对A表进 ... -
mysqldump使用心得
2013-11-21 15:08 1035一、启用gtid时,部分库、表导出时,需要添加--set-gt ... -
sysbench 0.5安装步骤
2013-07-04 17:23 4152sysbench源代码可以在https://launchpad ... -
Linux平台文件大小的限制
2013-05-03 15:17 796Oracle中文件大小的限制为32G,是由rowid限制导致的 ... -
MySQL中忘记root密码的解决办法
2013-05-03 15:14 775可以用--skip-grant-tables选项启动服务器,启 ... -
MySQL中InnoDB存储引擎的事务隔离级别与事务处理
2013-05-03 15:04 7221、事务进行中,不得用set transaction命令更改隔 ... -
MySQL连接方式
2013-04-02 12:55 2463MySQL除了最常见的TCP连接方式外,还提供SOCKET(L ... -
Redhat Linux 5.x上启动多个mysql 5.6.10实例
2013-04-02 10:51 1612首先,确认MySQL 5.6.10软件已经安装。如未安装,请参 ... -
Redhat Linux 5.x上安装mysql 5.6.10
2013-04-02 10:14 3855一、获取安装文件 从MyS ... -
Keepalive+mysql(主主)高可用测试
2013-03-31 17:38 0原文:Keepalive+mysql(主主)高可用测试 htt ... -
keepalived参考文章
2013-03-30 20:34 1169keepalived 实现热备 http://i-david. ...
相关推荐
### MySQL常用语句详解 #### 一、MySQL服务器的基本操作 在进行MySQL数据库的操作之前,首先需要确保MySQL服务器已经正确安装并且能够正常运行。 - **安装MySQL为Windows服务** ```sql C:>mysqld --install `...
以上内容仅是MySQL命令的简要介绍,实际操作中还有许多其他高级功能和选项,如索引、视图、触发器、存储过程等,需要根据具体需求深入学习。掌握这些基本命令,能帮助你有效地管理和维护MySQL数据库。
**MySQL常用工具SQLyog小海豚** MySQL是一款广泛使用的开源关系型数据库管理系统,而SQLyog是针对MySQL设计的一款图形化管理工具,被誉为“小海豚”。它以其直观的界面、强大的功能和高效的性能,使得数据库管理和...
以下是一些关于操作MySQL数据库的常用命令的详细说明: 1. **连接MySQL**:使用`mysql -u 用户名 -p`命令可以连接到MySQL服务器,其中`-u`指定用户名,`-p`会提示输入密码。例如,连接名为root的用户,命令是`mysql...
MySQL数据库常用命令汇总 MySQL数据库是目前最流行的开源关系数据库管理系统,它提供了丰富的命令来管理和操作数据库。本文汇总了MySQL数据库常用的命令,包括数据库操作、表操作和数据操作三部分。 数据库操作 1...
mysql常用操作注意:MySQL中每个命令后都要以分号;结尾。
MySQL 常用命令大全 本文档旨在总结 MySQL 的常用命令,旨在帮助开发者快速掌握 MySQL 的基本操作命令。下面将详细介绍 MySQL 的基本命令,包括启动 MySQL、数据库操作、表操作、数据操作等方面。 一、命令行指令 ...
mysql的选项文件my.ini,常用内容已写好,并且保存的是ansi格式,满足使用需要,在凑字数.
### MySQL常用命令详解 #### 一、MySQL备份与恢复命令:`mysqldump` `mysqldump`是MySQL数据库管理系统中一个非常重要的工具,主要用于数据库的备份操作。通过这个命令,用户可以将数据库中的数据导出为SQL脚本...
MySQL 常用语句查询 MySQL 是一种关系数据库管理系统(RDBMS),它可以帮助我们存储、管理和检索数据。本文将对 MySQL 中的一些常用语句进行查询和介绍。 登录 MySQL 要登录 MySQL,我们可以使用以下命令: `...
以下是对标题和描述中提到的一些MySQL常用命令的详细解释: 1. **导出数据库和表** - `mysqldump` 是用于备份和导出数据库或表的数据及结构的工具。 - **导出整个数据库**:`mysqldump -u 用户名 -p --default-...
了解并熟练掌握其常用命令对于数据库管理和开发工作至关重要。以下是一些关键的MySQL命令及其详细解释: **导出与导入数据库和表** 1. **导出整个数据库**: `mysqldump -u 用户名 -p --default-character-set=...
以下是一些与MySQL相关的常用命令和知识点的详细说明: 1. 数据库操作 - 显示所有数据库:`SHOW DATABASES;` - 创建新数据库:`CREATE DATABASE IF NOT EXISTS database_name;` - 使用数据库:`USE database_...
### MySQL 指定程序选项详解 #### 一、概述 在MySQL的使用过程中,能够高效灵活地控制程序的行为对于数据库管理员和开发人员至关重要。本文档详细介绍了如何为MySQL的各种程序(包括服务器mysqld、客户端工具mysql...
以下是关于MySQL常用指令的详细说明: 1. **安装与卸载MySQL**: - 检测是否已安装MySQL:`rpm -qa | grep mysql` - 卸载MySQL(普通模式):`rpm -e mysql` - 强力删除MySQL(包括依赖文件):`rpm -e --nodeps...
用户通过填写表格或者使用预定义的选项,工具会自动生成相应的SQL代码。这对于快速生成复杂的查询和避免语法错误非常有帮助。例如,它可以帮助生成JOIN查询、子查询、联接多表、使用函数和聚合操作的SQL语句。 7. ...
### MySQL常用命令详解 #### 一、连接与断开MySQL **命令:** ``` mysql -h 主机地址 -u 用户名 -p ``` **功能:** 此命令用于连接MySQL服务器。`-h`参数指定MySQL服务器所在的主机地址;`-u`参数指定登录MySQL的...
以下是一些常用的MySQL命令: 1. **显示数据库**: 使用`SHOW DATABASES;`命令可以查看服务器上现有的所有数据库。 2. **创建数据库**: 若要创建一个新的数据库,使用`CREATE DATABASE name;`命令,其中`name`...
了解其常用命令对于数据库管理员和开发者至关重要。以下是一些重要的MySQL命令及其详细说明: 1. **登录密码修改**: 使用`mysqladmin -u 用户名 -p 旧密码 password 新密码`命令可更改MySQL的登录密码。例如,...