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上如果要安装数据库, ...
随机推荐
- 强化Linux安全的10个技能
1.找出不必要的服务 很明显,服务器上跑的服务,并不是每个都有用的.强烈建议检查并关掉不需要的服务,从而减少风险(多跑一个服务,就可能多几个漏洞). 查询运行在runlevel 3的服务列表: [af ...
- Spring(二十):Spring AOP(四):基于配置文件的方式来配置 AOP
基于配置文件的方式来配置 AOP 前边三个章节<Spring(十七):Spring AOP(一):简介>.<Spring(十八):Spring AOP(二):通知(前置.后置.返回. ...
- c#:对两个字符串大小比较(不使用c#/java内部的比较函数),按升序排序
题目:首先需要实现一个函数:两个字符串大小比较(不得使用c#/java系统函数)的自定义函数:之后对一个字符串数据进行按升序排序(在排序过程中使用字符串大小比较时,使用自定义的字符串大小比较函数). ...
- 编译安装openssl报错:POD document had syntax errors at /usr/bin/pod2man line 69. make: *** [install_docs]
错误如下: cms.pod around line 457: Expected text after =item, not a number cms.pod around line 461: Expe ...
- 微服务架构实践 - 你只懂docker与spring boot就够了吗?
微服务架构实践 - 你只懂docker与spring boot就够了吗? 作者 浮云发发 已关注 2017.02.27 02:50* 字数 2613 阅读 2583评论 6喜欢 35赞赏 2 微服务并 ...
- Android Device Monitor工具的使用
在最新的Android Studio3.x版本中,已经去掉了Android Device Monitor工具,但是不代表Android Device Monitor工具就不能用了,找到sdk的目录: ...
- iOS开发点滴 - 关闭键盘
有时候系统显示的键盘会挡住视图中某些重要的控件,这个时候当用户按下换行键,就应该取消UITextField对象的第一响应(First Responder)状态而关闭键盘. 1. 首先,视图控制器必须遵 ...
- 使用Newtonsoft进行JSON序列化时将枚举序列化为字符串的方法
一.实体书写 将枚举类型的属性前面加上[JsonConverter(typeof(StringEnumConverter))]即可. 二.举例 [JsonConverter(typeof(String ...
- 关于LINUX在中断(硬软)中不能睡眠的真正原因
摘自http://bbs.chinaunix.net/thread-2115820-1-1.html 4楼的回答 先把中断处理流程给出来 1.进入中断处理程序--->2.保存关键上下文----& ...
- Linux常用命令之wget
wget:从网络上下载文件到当前目录.