见mysqld部分的黑体字
[client]
port=3306
[mysql]
default-character-set=gbk
# 服务器部分
# ----------------------------------------------------------------------
# The following options will be read by the MySQL Server. Make sure that
# you have installed the server correctly (see above) so it reads this
# file.
#
[mysqld]
port = 3306
skip-locking
key_buffer = 256M
max_allowed_packet = 300M
table_cache = 51200
sort_buffer_size = 16M
read_buffer_size = 16M
read_rnd_buffer_size = 60M
myisam_sort_buffer_size = 180M
thread_cache_size = 120
query_cache_size= 256M
#bind-address=192.168.8.228 #如果其他客户端访问服务器时 无法连接或找不到主机,可能需要打开此项
# The TCP/IP Port the MySQL Server will listen on
port=3306
#错误日志
# 错误日志在Mysql数据库中很重要,它记录着mysqld启动和停止,以及服务器在运行过程中发生的任何错误的相关信息,如果未指定
#默认hostname.err做为文件名,默认存放在DATADIR目录中。
log-error="F:/mysql/logs/log-err.log"
#通用查询日志
#默认为主机名(hostname)做为文件名,默认存放在DATADIR目录中。
log="F:/mysql/logs/log.log"
log-output = TABLE,FILE #加上此参数可以同时把日志存储到数据表中,mysql库下。一般为CVS格式 ,当然可选其中一个参数就行,默认是FILE值
# 二进制日志
#如果没有指定,默认为主机名后面跟-bin做为文件名,默认存放在DATADIR目录中。
log-bin="F:/mysql/logs/log-bin.log"
#生成格式为 mysql-binlog.00000X 形式
#由于binlog以是binary方式存取,不能直接查看,需要用mysql提供的mysqlbinlog工具查看。
#删除binlog
# (1).用reset master命令删除所有日志,新日志重新从000001开始编号
# (2).用purge master logs to 'mysq-bin.******' 命令可以删除指定编号前的所有日志
# (3).用purge master logs to before 'YYYY-MM-DD HH24:MI:SS'命令可以删除'YYYY-MM-DD HH24:MI:SS'之前的产生的#
#所有日志
# (4).可以在my.cnf中指定--expire_logs_days=#,此参数设置了binlog日志的过期天数
#慢速查询日志
#默认为hostname-slow.log做为文件名,默认存放在DATADIR目录中
log-slow-queries="F:/mysql/logs/log-slow-query.log"
long-query-time = 1 #此值默认为10,最小为1,Mysql 5.1有个google的补丁可以准确的毫秒。
log-queries-not-using-indexes = 1 #没使用索引的查询,存储过程会认为没使用索引而记录下来,默认是0。
#更新日志
#log-update="F:/mysql/logs/log-update.log"
#使用 show variables like '%log%'; 命令可以查看当前日志相关设置。
#mysql安装根目录.
basedir="F:/mysql/"
#数据库数据目录
datadir="F:/mysql/Data/"
# 默认字符编码设置,当表被创建时默认的编码
default-character-set=latin1
# 创建表时的 默认存储引擎
default-storage-engine=INNODB
# 设置 SQL mode
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
# MySQL server允许的最大并发连接数
max_connections=100