新闻资讯
记录首创点滴进步 见证远行
我们一直紧跟时代前沿,聚焦行业实时动态,发布公司最新资讯,欢迎您的关注
您目前的位置:网站首页 > 新闻资讯 > 网站常识 >

5.18日音讯,my.ini知识及详解

发布日期:2013-05-18文章来源:首创网络浏览次数:709次
    5.18日音讯,my.ini知识及详解。CLIENTSECTION 客户端章节: [client] port=3306端口号=3306 [mysql] default-character-set=latin1默认字符编码=latin1 SERVERSECTION 服务端章节 [mysqld] #TheTCP/IPPorttheMySQLServerwilllistenon TCP/IPPort监听mysql的端口号 port=3306 #......
    本文关键字:5.18日,音讯,my.ini,知识,及,详解,5.18日,音讯,
  5.18日音讯,my.ini知识及详解。CLIENTSECTION
  客户端章节:
  [client]
  port=3306端口号=3306
  [mysql]
  default-character-set=latin1默认字符编码=latin1
  SERVERSECTION
  服务端章节
  [mysqld]
  #TheTCP/IPPorttheMySQLServerwilllistenon
  TCP/IPPort监听mysql的端口号
  port=3306
  #Pathtoinstallationdirectory.Allpathsareusuallyresolvedrelativetothis.
  安装目录路径。所有的路径都是作为这个路径的相对路径。
  basedir="E:/programfile/MySql5.1/"
  #Pathtothedatabaseroot
  数据库数据的根路径
  datadir="C:/ProgramData/MySQL/MySQLServer5.1/Data/"
  #Thedefaultcharactersetthatwillbeusedwhenanewschemaortableis
  #createdandnocharactersetisdefined
  默认的字符集编码作用于当一个新的schema或者表被创建的时候没有指定字符集。
  default-character-set=latin1
  #Thedefaultstorageenginethatwillbeusedwhencreatenewtableswhen
  默认的存储引擎作用于当创建新表的时候
  default-storage-engine=INNODB
  #SettheSQLmodetostrict
  设置严格的SQL模型
  sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
  #ThemaximumamountofconcurrentsessionstheMySQLserverwill
  #allow.Oneoftheseconnectionswillbereservedforauserwith
  #SUPERprivilegestoallowtheadministratortologinevenifthe
  #connectionlimithasbeenreached.
  Mysql服务端允许最大的并发数,其中一个连接将留给用户使用超级权限连接数据库,即使连接数已经达到最高限额
  max_connections=100
  #QuerycacheisusedtocacheSELECTresultsandlaterreturnthem
  #withoutactualexecutingthesamequeryonceagain.Havingthequery
  #cacheenabledmayresultinsignificantspeedimprovements,ifyour
  #havealotofidenticalqueriesandrarelychangingtables.Seethe
  #"Qcache_lowmem_prunes"statusvariabletocheckifthecurrentvalue
  #ishighenoughforyourload.
  #Note:Incaseyourtableschangeveryoftenorifyourqueriesare
  #textuallydifferenteverytime,thequerycachemayresultina
  #slowdowninsteadofaperformanceimprovement.
  查询缓存用于在缓存中SELECT结果,返回不是实际查询数据库的结果。
  从缓存中查询的结果会显著的提升查询速度,如果你有很多相同的查询和很少改变表结构。
  查看“Qcache_lowmem_prunes”状态变量来检查当前值对于你的负载是否足够高。
  NOTE:如果你的表结构经常改变或者,你每次查询都不相同,那么使用查询缓存结果可能不是一个性能改进。
  query_cache_size=15M
  #Thenumberofopentablesforallthreads.Increasingthisvalue
  #increasesthenumberoffiledescriptorsthatmysqldrequires.
  #Thereforeyouhavetomakesuretosettheamountofopenfiles
  #allowedtoatleast4096inthevariable"open-files-limit"in
  #section[mysqld_safe]
  所有的线程打开表的数量。
  table_cache=256
  #Maximumsizeforinternal(in-memory)temporarytables.Ifatable
  #growslargerthanthisvalue,itisautomaticallyconvertedtodisk
  #basedtableThislimitationisforasingletable.Therecanbemany
  #ofthem.
  临时表最大内存大小。如果一个表生长大于这个值,它会自动转换为磁盘,这只是限制单个表,可以有很多个
  tmp_table_size=18M
  #Howmanythreadsweshouldkeepinacacheforreuse.Whenaclient
  #disconnects,theclient'sthreadsareputinthecacheiftherearen't
  #morethanthread_cache_sizethreadsfrombefore.Thisgreatlyreduces
  #theamountofthreadcreationsneededifyouhavealotofnew
  #connections.(Normallythisdoesn'tgiveanotableperformance
  #improvementifyouhaveagoodthreadimplementation.)
  有很多线程我们应该保持在一个缓存里以便重用。在没有超过超过线程缓存大小之前,当一个客户端断开连接时,把客户端线程放在缓存中。如果你有很多新的连接,那么这大大降低了线程的数量创造需要。(如果你有一个好的改进线程实现方案,那么这个并不会给出一个显著的性能)
  thread_cache_size=8
  #***MyISAMSpecificoptions
  MYISAM特殊配置项
  #ThemaximumsizeofthetemporaryfileMySQLisallowedtousewhile
  #recreatingtheindex(duringREPAIR,ALTERTABLEorLOADDATAINFILE.
  #Ifthefile-sizewouldbebiggerthanthis,theindexwillbecreated
  #throughthekeycache(whichisslower).
  Mysql临时文件允许使用重建索引(在修复,修改表结构,导入数据文件时)的最大大小。
  如果文件大小会比这个大,该指数将被创建通过键缓存(很慢)
  myisam_max_sort_file_size=100G
  #Ifthetemporaryfileusedforfastindexcreationwouldbebigger
  #thanusingthekeycachebytheamountspecifiedhere,thenpreferthe
  #keycachemethod.Thisismainlyusedtoforcelongcharacterkeysin
  #largetablestousetheslowerkeycachemethodtocreatetheindex.
  如果临时文件用于快速创建索引将比使用键缓存更大,那么键缓存的方法是很好的。这主要用于在比较大型的表使用缓慢的基础上,使用长字符串创建索引。
  myisam_sort_buffer_size=35M
  #SizeoftheKeyBuffer,usedtocacheindexblocksforMyISAMtables.
  #Donotsetitlargerthan30%ofyouravailablememory,assomememory
  #isalsorequiredbytheOStocacherows.Evenifyou'renotusing
  #MyISAMtables,youshouldstillsetitto8-64Masitwillalsobe
  #usedforinternaltemporarydisktables.
  在MyISAM表里用于缓存索引块。不要把它设置为大于你的可用内存的30%,因为一些内存还需要由OS缓存行,即使您没有使用MyISAM表,您仍然应该将其设置为8-64m,因为它也会用于内部临时磁盘表
  key_buffer_size=8M
  #SizeofthebufferusedfordoingfulltablescansofMyISAMtables.
  #Allocatedperthread,ifafullscanisneeded.
  MyISAM表用来做全表扫描的缓冲区大小
  如果需要一个完整的扫描,就分配给每一个线程
  read_buffer_size=64K
  read_rnd_buffer_size=256K
  #ThisbufferisallocatedwhenMySQLneedstorebuildtheindexin
  #REPAIR,OPTIMZE,ALTERtablestatementsaswellasinLOADDATAINFILE
  #intoanemptytable.Itisallocatedperthreadsobecarefulwith
  #largesettings.
  这个缓冲区是分配给:当MYSQL在需要修理,OPTIMZE,修改表结构语句以及导入加载数据
  到一个空表时重建索引。它是分配给每个线程,所以在大型设置中要小心使用。
  sort_buffer_size=256K
  #***INNODBSpecificoptions***
  INNODB特殊项
  INNODB保存数据目录
  innodb_data_home_dir="E:/MySQLDatafiles/"
  #UsethisoptionifyouhaveaMySQLserverwithInnoDBsupportenabled
  #butyoudonotplantouseit.Thiswillsavememoryanddiskspace
  #andspeedupsomethings.
  #skip-innodb
  #AdditionalmemorypoolthatisusedbyInnoDBtostoremetadata
  #information.IfInnoDBrequiresmorememoryforthispurposeitwill
  #starttoallocateitfromtheOS.Asthisisfastenoughonmost
  #recentoperatingsystems,younormallydonotneedtochangethis
  #value.SHOWINNODBSTATUSwilldisplaythecurrentamountused.
  InnoDB存储元数据信息时的额外的内存池。如果需要更多的内存,InnoDB为此它会分配它的操作系统内存。因为在大多数操作系统中,这已经是足够快的了,所以通常不需要修改这个值。SHOWINNODBSTATUS会显示当前的使用量
  innodb_additional_mem_pool_size=2M
  #Ifsetto1,InnoDBwillflush(fsync)thetransactionlogstothe
  #diskateachcommit,whichoffersfullACIDbehavior.Ifyouare
  #willingtocompromisethissafety,andyouarerunningsmall
  #transactions,youmaysetthisto0or2toreducediskI/Otothe
  #logs.Value0meansthatthelogisonlywrittentothelogfileand
  #thelogfileflushedtodiskapproximatelyoncepersecond.Value2
  #meansthelogiswrittentothelogfileateachcommit,butthelog
  #fileisonlyflushedtodiskapproximatelyoncepersecond.
  如果设置为1,InnoDB会在每个提交磁盘冲洗事务日志,这提供了完整的ACID的行为.
  如果你想安全,并且正在执行一些小操作,你可以设置为0或者2在减少磁盘I/O日志。
  #innodb_flush_log_at_trx_commit=1
  #ThesizeofthebufferInnoDBusesforbufferinglogdata.Assoonas
  #itisfull,InnoDBwillhavetoflushittodisk.Asitisflushed
  #oncepersecondanyway,itdoesnotmakesensetohaveitverylarge
  #(evenwithlongtransactions).
  这个大小用于缓冲InnoDB在缓冲日志数据。一旦它满了,InnoDB会在磁盘上释放它。
  它无论如何都会一秒缓冲一次,这对于非常大的日志是没有意义的。(即使有长事务)
  innodb_log_buffer_size=1M
  #InnoDB,unlikeMyISAM,usesabufferpooltocachebothindexesand
  #rowdata.ThebiggeryousetthisthelessdiskI/Oisneededto
  #accessdataintables.Onadedicateddatabaseserveryoumaysetthis
  #parameterupto80%ofthemachinephysicalmemorysize.Donotsetit
  #toolarge,though,becausecompetitionofthephysicalmemorymay
  #causepagingintheoperatingsystem.Notethaton32bitsystemsyou
  #mightbelimitedto2-3.5Gofuserlevelmemoryperprocess,sodonot
  #setittoohigh.
  InnoDB,不像MyISAM,使用一个缓冲池来缓存的两个索引和行数据。这个磁盘I/O设置的更大,需要访问的数据表更少。在专用的数据库服务器上你可以设置参数高达80%的机器的物理内存大小。不用把它设置的太大,不过,因为在操作系统中竞争的物理内存可能导致内存不够分。注意,32位系统上的你可能被限制在2-3.5g的用户级内存,所以不要设置的太高。
  innodb_buffer_pool_size=83M
  #Sizeofeachlogfileinaloggroup.Youshouldsetthecombinedsize
  #oflogfilestoabout25%-100%ofyourbufferpoolsizetoavoid
  #unneededbufferpoolflushactivityonlogfileoverwrite.However,
  #notethatalargerlogfilesizewillincreasethetimeneededforthe
  #recoveryprocess.
  每个日志文件在日志组里的大小。你应该将日志文件大约为25%--100%缓冲池大小合并来避免不必要的缓冲池的缓冲行为覆盖日志文件。然而,一个大的日志文件将增加复苏过程的所需时间。
  innodb_log_file_size=17M
  #NumberofthreadsallowedinsidetheInnoDBkernel.Theoptimalvalue
  #dependshighlyontheapplication,hardwareaswellastheOS
  #schedulerproperties.Atoohighvaluemayleadtothreadthrashing.
  InnoDB的内核允许多线程。最高性能取决于高的应用程序、硬件以及操作系统。
  一个很高的值可能导致线程抖动
  innodb_thread_concurrency=8
    本文由邯郸网络公司首创网络整理编辑发布,请勿转载、复制、摘抄等!

+ 查看更多我们的客户 / Our client

0310-4559740
400-990-1661
    24小时报务热线
    18931045623
在线客服
首创网络邯郸公司
邯郸公司
电话:0310-4559740 / 18931045623  地址:邯郸市丛台区颐高广场B座13层1304室