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命令学习——tar
tar命令用来处理压缩,压缩和解压.在linux上经常遇到tar命令,总结如下: tar-c: 建立压缩档案-x:解压-t:查看内容-r:向压缩归档文件末尾追加文件-u:更新原压缩包中的文件这五个是独 ...
- [Algorithm] Check for balanced parentheses using stack
Algorithm or program to check for balanced parentheses in an expression using stack data structure. ...
- spring mvc mongoDb
http://www.cnblogs.com/dennisit/p/3372568.html 系统环境: 操作系统: windows xp 数 据 库: mongodb2.0.6 驱 动 包: S ...
- phpstudy部署thinkPHP
利用phpstudy配置虚拟主机 Listen 8080 <VirtualHost _default_:80> DocumentRoot "D:\phpStudy\WWW&quo ...
- JavaScript正则式练习
使用正则式匹配第一个数字和最后一个数字,使用环视 str2 = 09051 : Fast Food Restaurants - Concession Stands/Snack Bars Delicat ...
- Android sdk content loader 0%
打开Eclipse以后,一直在Android sdk content loader 0%,等了很长时间都没有变,解决的方法是Project->Clean->Clean all projec ...
- 算法笔记_222:串中取3个不重复字母(Java)
目录 1 问题描述 2 解决方案 1 问题描述 从标准输入读入一个由字母构成的串(不大于30个字符). 从该串中取出3个不重复的字符,求所有的取法. 取出的字符,要求按字母升序排列成一个串. 不同 ...
- 一、Django用Eclipse编写一个登录界面
一.Django用Eclipse编写一个登录界面 二.Django用Eclipse编写一个登录界面Ajax和Django交互 Eclipse安装Python插件和Django的步骤直接省略. 创建de ...
- 再次编译 arm toolchains
为什么说再呢,因为已经好多次了.每次失败,都再从失败的地方开始.今天这篇呢,主要是记录今天的进展. 1. 编译要分三步走 之前学习的时候就有印象,要三步走.但是因为没有实践过,所以,忘差不多了.所谓三 ...
- LeetCode] binaryTreePaths
class Solution { public: void binaryPath(TreeNode* root, vector<string>& result, string pa ...