Linux MySQL 4G内存my.cnf配置表(转)
# The following options will be passed to all MySQL clients
[client]
character-set-server = utf8 #####客户端默认连接字集集,若编译安装时已指定则不用填写
port = 3306 ###客户端连接通信端口
socket = /tmp/mysql.sock #客户端通信的用户密码端口等信息保存文件
# Here follows entries for some specific programs
# The MySQL server
[mysqld]
port = 3306 #mysql服务端监听端口
basedir = /usr/local/mysql ###Mysql软件目录
datadir = /usr/local/mysql/var ###mysql数据库存放目录
socket = /tmp/mysql.sock ##服务端通信文件,若丢失则重启Mysql重新生成,若重启失败,则可能由于mysqld进程未杀死,用pkill mysql后则能重启成功Mysql
pid-file =/usr/local/mysql/var/mysql.pid ##服务端pid进程文件,若丢失则重启Mysql重新生成,若重启失败,则可能由于mysqld进程未杀死,用pkill mysql后则能重启成功Mysql
skip-external-locking ###防止外部锁定表
skip-name-resolve ###禁止Mysqlr的DNS解析,只能通过IP连接数据库
key_buffer_size = 384M ###仅针对Myisam表引擎缓存优化
max_allowed_packet = 32M ###客户端最大查询表使用的内存
table_open_cache = 1024 ###服务器最大缓存表数量
sort_buffer_size = 2M ##每个连接的最大排序内存
join_buffer_size = 1M ##每个连接使用join查询语句的最大内存
net_buffer_length = 1M
read_buffer_size = 2M
read_rnd_buffer_size = 16M
myisam_sort_buffer_size = 128M
thread_cache_size = 300
query_cache_size = 256M
query_cache_limit = 2M
thread_concurrency = 4 ##CPU*2
wait_timeout = 120 ###SQL语句最大执行时间
max_connections = 5000 ###允许数据库最大连接数
max_connect_errors = 6000 ##允许客户端连接数据库出错次数,能防止暴力破解数据库密码
character-set-server = utf8 ##服务器和数据库默认字符集
collation-server = utf8_general_ci ###客户端校正字符集
log_slow_queries = slowquery.log ##慢查询日志文件
long_query_time = 3 ###慢查询时间
myisam_recover ###mysql重启自动修复MYisam表
replicate-ignore-db = mysql ###数据同步时不需要同步的数据库名称
replicate-ignore-db = information_schema
bind-address = 121.14.145.96 ##服务器多个IP时写上比较重要
# Don't listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (via the "enable-named-pipe" option) will render mysqld useless!
#
#skip-networking
# Replication Master Server (default)
# binary logging is required for replication
log-bin=mysql-bin
# binary logging format - mixed recommended
binlog_format=mixed
# required unique id between 1 and 2^32 - 1
# defaults to 1 if master-host is not set
# but will not function as a master if omitted
server-id = 1
# Uncomment the following if you are using InnoDB tables
#innodb_data_home_dir = /usr/local/mysql/var
#innodb_data_file_path = ibdata1:10M:autoextend
#innodb_log_group_home_dir = /usr/local/mysql/var
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
#innodb_buffer_pool_size = 16M
#innodb_additional_mem_pool_size = 2M
# Set .._log_file_size to 25 % of buffer pool size
#innodb_log_file_size = 5M
#innodb_log_buffer_size = 8M
#innodb_flush_log_at_trx_commit = 1
#innodb_lock_wait_timeout = 50
[mysqldump]
quick
max_allowed_packet = 32M
[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates
[myisamchk]
key_buffer_size = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeout
Linux MySQL 4G内存my.cnf配置表(转)的更多相关文章
- linux mysql 数据库操作导入导出 数据表导出导入
linux mysql 数据库操作导入导出 数据表导出导入 1,数据库导入 mysql -uroot -p show databases; create database newdb; use 数据库 ...
- linux mysql 卸载与安装及配置命令
1.RPM包安装方式的MySQL卸载 1) 检查是否安装了MySQL组件. # rpm -qa | grep -i mysql 2)卸载前关闭MySQL服务 # service mysql statu ...
- 【mysql】如何通过navicat配置表与表的多对一关系,一对一关系?设计外键的效果
背景: 现在要将接口自动化测试结果持久化,当前只是每次运行接口测试,将测试结果通过邮件发送给项目组成员.邮件内容如下: 表设计: 为了呈现这个结果:我设计了2张表run_result和run_deta ...
- mysql 5.7 my.cnf配置
此为配置上生产环境的参数,后续补充参数说明 [client] port=3306 socket = /data/mysql/tmp/mysql.sock # default-character-set ...
- windows mysql主 Linux mysql 从 主从同步,读写分离
Mysql –master linux-slave 一.My.ini: Server-id=1 relay-log=relay-bin relay-log-index=relay-bin-index ...
- MYSQL服务器my.cnf配置文档详解
MYSQL服务器my.cnf配置文档详解 硬件:内存16G [client] port = 3306 socket = /data/3306/mysql.sock [mysql] no-auto-re ...
- Mariadb/MySQL生产环境的my.cnf配置示例
Mariadb/MySQL生产环境的my.cnf配置示例 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.针对MySQL主程序mysqld定义参数[mysqld] 1>. ...
- Linux Mysql数据库安全配置
Linux Mysql数据库安全配置 目录: 1.修改mysql管理员账号root的密码(2种方法) 2.修改mysql管理员账号root 3.mysql管理员root账号密码遗忘解决办法(2种方法 ...
- linux学习之centos(三):mysql数据库的安装和配置
前言:mysql简介 说到数据库,我们大多想到的是关系型数据库,比如mysql.oracle.sqlserver等等,这些数据库软件在windows上安装都非常的方便,在Linux上如果要安装数据库, ...
随机推荐
- JS 判断浏览器是否安装Flash 兼容IE、firefox
/** * @Author: HTL * @Email: Huangyuan413026@163.com * @DateTime: 2016-06-02 11:37:05 * @Description ...
- 转:ffmpeg time_base详解
ffmpeg time_base详解 https://my.oschina.net/u/3054677/blog/866368
- (转)Unity3d中的碰撞检测
很多时候,当我们的主角与其他GameObject发生碰撞时, 我们需要做一些特殊的事情,比如:子弹击中敌人,敌人就得执行一系列的动作.这时,我们就需要检测到碰撞现象,即碰撞检测.这一篇,我来具体谈谈自 ...
- Softmax 函数的特点和作用是什么?
作者:张欣链接:https://www.zhihu.com/question/23765351/answer/98897364来源:知乎著作权归作者所有,转载请联系作者获得授权. softmax 回归 ...
- Redis源代码剖析--对象object
前面一系列的博客分析了Redis的基本数据结构,有动态字符串sds.双端链表sdlist.字典dict.跳跃表skiplist.整数集合intset和压缩列表ziplist等,这些数据结构对于用户来说 ...
- ActiveMQ面试专题
https://blog.csdn.net/belvine/article/details/79399798
- 微软BI 之SSRS 系列 - 使用分组 Group 属性实现基于父子递归关系的汇总报表
基于父子关系的递归结构在公司组织结构里比较常见,基本上都是在一张表里实现的自引用关系.在报表中如果要实现这种效果,并且在这个基础上做一些数据的汇总,可以使用到下面提到的方法. 要实现的效果大致如下 - ...
- C++ 第五课:C/C++ 数据类型
C语言包含5个基本数据类型: void, integer, float, double, 和 char. 类型 描述 void 空类型 int 整型 float 浮点类型 double 双精度浮点类型 ...
- excel自定义数据验证
1. 判断必须为5位或者9位的数字 2. 自定义限制级别和提示消息
- poj - 1191 - 棋盘切割(dp)
题意:将一个8*8的棋盘(每一个单元正方形有个分值)沿直线(竖或横)割掉一块,留下一块,对留下的这块继续这样操作,总共进行n - 1次,得到n块(1 < n < 15)矩形,每一个矩形的分 ...