数据库|mysql教程
mysql
数据库-mysql教程
第一种
情人节创意源码,ubuntu怎么创建桌面,如何用tomcat运行程序,传智java爬虫,php数据库自动备份,厦门seo建议lzw
#This File was made using the WinMySQLAdmin 1.4 Tool
#-2-23 16:28:14
#Uncomment or Add only the keys that you know how works.
#Read the MySQL Manual for instructions
[mysqld]
basedir=D:/mysql
#bind-address=210.5.*.*
datadir=D:/mysql/data
#language=D:/mysql/share/your language directory
#slow query log#=
#tmpdir#=
#port=3306
set-variable = max_connections=1500
skip-locking
#skip-networking
set-variable = key_buffer=384M
set-variable = max_allowed_packet=1M
set-variable = table_cache=512
set-variable = sort_buffer=2M
set-variable = record_buffer=2M
set-variable = thread_cache=8
# Try number of CPU’s*2 for thread_concurrency
set-variable = thread_concurrency=8
set-variable = myisam_sort_buffer_size=64M
#set-variable = connect_timeout=5
#set-variable = wait_timeout=5
server-id = 1
[isamchk]
set-variable = key_buffer=128M
set-variable = sort_buffer=128M
set-variable = read_buffer=2M
set-variable = write_buffer=2M
[myisamchk]
set-variable = key_buffer=128M
set-variable = sort_buffer=128M
set-variable = read_buffer=2M
set-variable = write_buffer=2M
[WinMySQLadmin]
Server=D:/mysql/bin/mysqld-nt.exe
神兽大牌九h5源码,在ubuntu新建用户,爬虫 点击 完成 判断,php问号后php可省略吗,西湖seo平台lzw
这个方案,整体够用了,但是在pconnect和最大连接数上,需要研究max_connections没必要那么大,我个人认为几百就够,否则给服务器加大了不少负担,经常会当机连接超时的设置也要根据实际情况调整,大家可以自由调整,然后观察效果如何。
第二种
7、MYSQL 的优化(/etc/f)
1)确认在“[mysqld]”部分加入了“skip-innodb”和“skip-bdb”参数;
2)确认在“[mysqld]”部分加入了“skip-name-resolve”和“skip-locking”参数;
3)如果不需要的话,可以将二进制日志(binlog)停掉,方法是将“log-bin”注释掉;
4)在内存允许的情况下,对一些参数进行重新配置,目标在于将大部分操作集中于内存中,尽量不进行磁盘操作,对于我的 MYSQL 服务器我是如下修改的,基于 2G 内存情况:
asp生日源码,vscode检测react,ubuntu pem,tomcat被锁住,sqlite取时间日期,web前端上传插件,前端ui框架开发教程,爬虫爬取网页系统概述,银联在线支付 php,seo优化省钱营销,宁志公安局网站管理系统,手机移动网页模板,freecms模板lzw
[mysqld]
set-variable = key_buffer=512M
set-variable = max_allowed_packet=4M
set-variable = table_cache=1024
set-variable = thread_cache=64
set-variable = join_buffer_size=32M
set-variable = sort_buffer=32M
set-variable = record_buffer=32M
set-variable = max_connections=512
set-variable = wait_timeout=120
set-variable = interactive_timeout=120
set-variable = max_connect_errors=30000
set-variable = long_query_time=1
set-variable = max_heap_table_size=256M
set-variable = tmp_table_size=128M
set-variable = thread_concurrency=8
set-variable = myisam_sort_buffer_size=128M
你可以根据“show status”命令返回的状态进行微调。我主要注意以下变量的数值,越小越好,最好为零:)
Created_tmp_disk_tables
Created_tmp_tables
Created_tmp_files
Slow_queries
另外 mysql wait_timeout 那个值设置大了没用 做10左右就可了 (大C说得)
wait_timeout是使用长久连线时 空闲进程的控制只要数据库在连接状态 他是不进行干预的 不管是否有查询或更新操作把这个设置小一点 再使用pconnect就比较理想了 ????
timeout的