5.18日(rì)音(yīn)訊,my.ini知(zhī)∏÷"識及詳解
日(rì)期:2013-05-18發布:首創網絡浏覽:682次
5.18日(rì)音(yīn)訊,my.ini知(zhī)識∑↔及詳解。CLIENTSECTION 客戶端章(zhāng)節: &↓ β[client] port=3306端口←>号=3306 [mysql] default-charact→¶er-set=latin1默認字符編碼=∑δ♥γlatin1 SERVE···
本文(wén)關鍵字:5.18日(rì),音(¶"yīn)訊,my.ini,知(zhī)識 ∏€,及,詳解,5.18日(rì),音(yīn)™φ♠訊,
5.18日(rì)音(yīn)訊,my.ini>知(zhī)識及詳解。CLIENTSECTION
客戶端章(zhāng)節:
[client]
port=3306端口号=3306"₹©
[mysql]
default-character-set=latin£φ ÷1默認字符編碼=latin1
SERVERSECTION
服務端章(zhāng)節
[mysqld]
#TheTCP/IPPorttheM←✘★ySQLServerwilllisten '¥ on
TCP/IPPort監聽(tīng)mysql的(de)端口号
port=3306
#Pathtoinstallati♦¶ondirectory.Allpathsareusuallyresol ¶↔φvedrelativetothis.
安裝目錄路(lù)徑。所有(yǒu)的(d∏≠e)路(lù)徑都(dōu)是(shì)γ®♠作(zuò)為(wèi)這(zhè)個(gè)路(lù)徑∏™© 的(de)相(xiàng)對(duì)路(lù)徑<∑。
basedir="E:/programfil£ ¶e/MySql5.1/"
#Pathtothedatabaseroot
數(shù)據庫數(shù)據的(de)根路(lù)徑
datadir="C:/ProgramD←♠±≤ata/MySQL/MySQLServer5.1/Data/"
#Thedefaultcharactersetthatwillbγ<eusedwhenanewschemaortableis
#createdandnocharactersetis♦♦ defined
默認的(de)字符集編碼作(zuò)用(yòng)于當一(yī)個(∞βgè)新的(de)schema或者表被創建©∑的(de)時(shí)候沒有(yǒu)指定★₹€™字符集。
default-character-set=latin1
#Thedefaultstorageenginethatwillbeus★Ωedwhencreatenewtablesw±≠'hen
默認的(de)存儲引擎作(zuò)用(yòng)于當創建新表的(de)時δ☆±₹(shí)候
default-storage-engine=IN→NODB
#SettheSQLmodetostrict
設置嚴格的(de)SQL模型
sql-mode="STRICT_TRANS_TABLES,NO_±φφσAUTO_CREATE_USER,NO_ENGINE_S©∏₽✘UBSTITUTION"
#Themaximumamountofconcu↑"rrentsessionstheMySQLserverwill
#allow.Oneoftheseconnectionswi₽πllbereservedforauserwit≥₩✘h
#SUPERprivilegestoal≤£×lowtheadministratort¶←ologinevenifthe
#connectionlimithasbee©∏nreached.
Mysql服務端允許最大(dà)的(de)并發數(sh←Ωù),其中一(yī)個(gè)連接将留給用(yòng)戶使用(yòng π')超級權限連接數(shù)據庫,即使連接數(shù)已經×達到(dào)最高(gāo)限額
max_connections=100
#QuerycacheisusedtocacheSEL☆☆★≥ECTresultsandlaterreturnthem
#withoutactualexecutingt®>hesamequeryonceagain.Havingt↔>σhequery
#cacheenabledmayresultinsignif π>icantspeedimprovements,α¶ifyour
#havealotofidenticalq¶$φ≠ueriesandrarelychangingta←&bles.Seethe
#"Qcache_lowmem_prune↕♠λs"statusvariabletocheckifthe ←±currentvalue
#ishighenoughforyourload.
#Note:Incaseyourta÷∑γbleschangeveryoftenorifyourqu ≠eriesare
#textuallydifferen✔®teverytime,thequerycachemayresλ¶ultina
#slowdowninsteadof∑∞≠∏aperformanceimprovement.
查詢緩存用(yòng)于在緩存中SELECT結果,返回不(b✘★ù)是(shì)實際查詢數(shù)據庫的(de)結果。
從(cóng)緩存中查詢的(de)結果會(huì)顯著的(de)∑ 提升查詢速度,如(rú)果你(nǐ)有(yǒu)↕☆很(hěn)多(duō)相(xiàng)同的(de)查詢和(hé)很(λ ≠hěn)少(shǎo)改變表結構。
查看(kàn)“Qcache_lowme↕✘m_prunes”狀态變量來(lái±'≥)檢查當前值對(duì)于你(nǐ)的(de)負載是(shì)否足夠高'♦♦(gāo)。
NOTE:如(rú)果你(nǐ)的(de)表結構經常改變或者,你€∑ε(nǐ)每次查詢都(dōu)不(bù)相(xiàng)同,那(nà)麽使用(✔$yòng)查詢緩存結果可(kě)能(néng) ∑不(bù)是(shì)一(yī)個(gè)性能(néng)改進。
query_cache_size=1'&™5M
#Thenumberofopentablesforallthreads.↕×∑Increasingthisvalue
#increasesthenumberoffiledescriα§<↕ptorsthatmysqldrequires.
#Thereforeyouhave×→βtomakesuretosettheamounγπ∑tofopenfiles
#allowedtoatleast4096int≤✔hevariable"open-files-limit"in
#section[mysqld_safe♦✔π]
所有(yǒu)的(de)線程打開(kāi)表的(de)數(s ←hù)量。
table_cache=256
#Maximumsizeforinter§₽nal(in-memory)temporarytables.Ifatab•→γle
#growslargerthanthisvalue,itisautוσomaticallyconvertedtodisk
#basedtableThislim ✔®itationisforasingletable.Therec>σanbemany
#ofthem.
臨時(shí)表最大(dà)內(nèi)存大(dà)小(xiǎo)。如(≈≤∏$rú)果一(yī)個(gè)表生(shēng)長₩★♣(cháng)大(dà)于這(zhè)個(gè)值,它↕'₽↑會(huì)自(zì)動轉換為(wèi)磁盤,φ→這(zhè)隻是(shì)限制(zhì)單個(gè)表,可(kě)>σ以有(yǒu)很(hěn)多(duō)個(gè)
tmp_table_size=18M
#Howmanythreadsweshouldk<®∏eepinacacheforreuse.Whenaclient
#disconnects,theclient'sσ threadsareputinthecacheiftherearen't
#morethanthread_cache_sizetβ™♦hreadsfrombefore.Thisgre<§atlyreduces
#theamountofthreadcreationsneededi$∑fyouhavealotofnew
#connections.(Normallythis•♦Ω"doesn'tgiveanotableperforma£γ∏≈nce
#improvementifyouhav★♥↑®eagoodthreadimplementatio☆φn.)
有(yǒu)很(hěn)多(duō)線程÷≈ 我們應該保持在一(yī)個(gè)緩存裡λ★"(lǐ)以便重用(yòng)。在沒有(yǒu)超過超過線程緩存大(dà')小(xiǎo)之前,當一(yī)個(gè)客戶端斷開>☆δ(kāi)連接時(shí),把客戶端線程放(fà↕ε♥ng)在緩存中。如(rú)果你(nǐ)有(yǒu)很(hěn)多(d∏↔÷<uō)新的(de)連接,那(nà)麽這(zhè)大(dà)φ<φ大(dà)降低(dī)了(le)線程的(de)數(shù)✔∑¥量創造需要(yào)。(如(rú)果你(nǐ)有(yǒ∏ ₹↑u)一(yī)個(gè)好(hǎo)的(de)改進線程實現(xiàn)方↑ £案,那(nà)麽這(zhè)個(gè)并不(b≈÷∏ù)會(huì)給出一(yī)個(gè)顯著的(de)性能 ±↔$(néng))
thread_cache_size=8
#***MyISAMSpecificopti"÷ons
MYISAM特殊配置項
#Themaximumsizeofthe₩ΩΩtemporaryfileMySQLisal←'¶lowedtousewhile
#recreatingtheindex(duriπ©₹ ngREPAIR,ALTERTABLEorLOADDATAI★©©NFILE.
#Ifthefile-sizewouldbebiggerthanthi≈α∏®s,theindexwillbecreated
#throughthekeycache(whichisslowe₽δr).
Mysql臨時(shí)文(wénδ↓£&)件(jiàn)允許使用(yòng)重建索引(在修複,修改表結構,導入數(©≈÷shù)據文(wén)件(jiàn)時(s✔"≥hí))的(de)最大(dà)大(dà)小λ"<≠(xiǎo)。
如(rú)果文(wén)件(jiàn)大(dà)♦≠δ小(xiǎo)會(huì)比這(zhè)個(gè)大(♥©δ'dà),該指數(shù)将被創建通(tōng)過鍵緩存(很(hě✘&✘n)慢(màn))
myisam_max_sort_file_siz±±e=100G
#Ifthetemporaryfileusedforfas tindexcreationwouldbebig×♥ger
#thanusingthekeycachebytheamountspec→ifiedhere,thenpreferthe
#keycachemethod.T♠αλhisismainlyusedtoforcelong$±characterkeysin
#largetablestousetheslowerkey'∏cachemethodtocreatetheindex.
如(rú)果臨時(shí)文(wén)件(jiàn)用(yòngα€)于快(kuài)速創建索引将比使用(yòng)鍵緩存更大(dà),那 ≠™→(nà)麽鍵緩存的(de)方法是(shì)很(hěn)好(hε'ǎo)的(de)。這(zhè)主要(yào)用(yò←>✔λng)于在比較大(dà)型的(de)表使用(yòng)緩慢↓™↑(màn)的(de)基礎上(shàng),使用(yò♥α←ng)長(cháng)字符串創建索引。
myisam_sort_buffer_size=€ 35M
#SizeoftheKeyBuffer,usedtocacheinde™¶xblocksforMyISAMtables.
#Donotsetitlargerthan30%ofyoδuravailablememory,assomememory★↔>
#isalsorequiredbyλ theOStocacherows.Evenify∑α≠ou'renotusing
#MyISAMtables,youshoul≥←•βdstillsetitto8-64Masitwillal®♥↓✔sobe
#usedforinternaltemporarydisk♣≠₹£tables.
在MyISAM表裡(lǐ)用(yòng)于緩存>∞索引塊。不(bù)要(yào)把它設置為(wèi)大(dà)于你(nǐ)的(d←®e)可(kě)用(yòng)內(nèi)存的(de)30%,因為(wèi)一(¥ ↕✔yī)些(xiē)內(nèi)存還(hái)需要(yào)由OS緩存行(x>∑∏≥íng),即使您沒有(yǒu)使用(yòngπ↕₩)MyISAM表,您仍然應該将其設置為(wèi¶ )8-64m,因為(wèi)它也(yě)會(huì)用(yòng)于內(nè€βi)部臨時(shí)磁盤表
key_buffer_size=8M
#Sizeofthebufferusedfordoingful↑&™€ltablescansofMyISAMtables.
#Allocatedperthread,if₩•✔afullscanisneeded.
MyISAM表用(yòng)來(lái)做(z★λσ↓uò)全表掃描的(de)緩沖區(qū)大(dà)小(xiǎo)
如(rú)果需要(yào)一(yī)個(gè§πβ)完整的(de)掃描,就(jiù)分(fēn)配給每一(y↕★¶★ī)個(gè)線程
read_buffer_size=64K
read_rnd_buffer_size=256K
#ThisbufferisallocatedwhenMySQLneed♠∏storebuildtheindexin
#REPAIR,OPTIMZE,ALTERtablestatem≤"&entsaswellasinLOADDATAINFILE
#intoanemptytable.Itisalloca★₹&tedperthreadsobecarefulwith
#largesettings.
這(zhè)個(gè)緩沖區(qū)♠₩是(shì)分(fēn)配給:當MYSQL在需要(yào)修理(lǐ),↔± OPTIMZE,修改表結構語句以及導入加載數(shù)≠ ☆據
到(dào)一(yī)個(gè)空(kōng)表♥ ₩✔時(shí)重建索引。它是(shì)分(fēn)§σ§配給每個(gè)線程,所以在大(dà)型✘γ₩設置中要(yào)小(xiǎo)心使用(yòng)。
sort_buffer_size=256K
#***INNODBSpecificoptions***
INNODB特殊項
INNODB保存數(shù)據目錄
innodb_data_home_diδ¥r="E:/MySQLDatafiles/"
#Usethisoptionifyou≤ε↓haveaMySQLserverwithInnoDBs∞< upportenabled
#butyoudonotplantous ©↕&eit.Thiswillsavememory±☆≠anddiskspace
#andspeedupsomethi®ngs.
#skip-innodb
#AdditionalmemorypoolthatisusedbyI↓≥π←nnoDBtostoremetadata
#information.IfInnoDBrequires≠↓morememoryforthispurposeitwilΩ≥βl
#starttoallocateitfromtheOS.∞©¶Asthisisfastenoughonmo≠↓Ω±st
#recentoperatingsystems,youα♠normallydonotneedtochan×↔gethis
#value.SHOWINNODBSTATUSwilld"♣↔isplaythecurrentamountused.
InnoDB存儲元數(shù)據信息時(shí)的(de)額外(wài)→ 的(de)內(nèi)存池。如(rú)果需要(yào)更多(duō)的 γ£(de)內(nèi)存,InnoDB為(wγ≥→$èi)此它會(huì)分(fēn)配它的(de)操作(zuò)系統內(nèi ∏♠∑)存。因為(wèi)在大(dà)多(duō)數(shù)操作(zuò)α φ"系統中,這(zhè)已經是(shì)足夠快(kuài)的(de)了(l"≈§≈e),所以通(tōng)常不(bù)需要(y$>↑↑ào)修改這(zhè)個(gè)值。SHOWINNODBSTATUS會(h¥¥✔uì)顯示當前的(de)使用(yòng)量
innodb_additional_mem_pool_s"λ↓≥ize=2M
#Ifsetto1,InnoDBwillflus₩ ¥☆h(fsync)thetransacti≤₩ε$onlogstothe
#diskateachcommit,whichoffers₹↔fullACIDbehavior.Ify ∑α∏ouare
#willingtocompromisethiss$←★&afety,andyouarerunni≤↓ngsmall
#transactions,youmaysetthisto0orβ♣®↑2toreducediskI/Otothe
#logs.Value0meansthatthe∏<$εlogisonlywrittentothelogfil₹λγeand
#thelogfileflushedtodi§ π₽skapproximatelyoncepersecond.Val>≤₩ue2
#meansthelogiswrittentothelogfilΩ≠↑♠eateachcommit,butthe∏✘€↑log
#fileisonlyflushedtodisk≥ £approximatelyoncepersecond.
如(rú)果設置為(wèi)1,InnoD £®B會(huì)在每個(gè)提交磁盤沖洗事(shì)務日(rì)★∞≈志(zhì),這(zhè)提供了(le)完整的(Ω∞™de)ACID的(de)行(xíng)為(wèi★✘★).
如(rú)果你(nǐ)想安全,并且正在執行(xíng)一(yīγ₩¥≈)些(xiē)小(xiǎo)操作(zuò),你(nǐ)可(kěλ'¶)以設置為(wèi)0或者2在減少(shǎo)磁盤I/O日(rì)•✘∏≥志(zhì)。
#innodb_flush_log_at_trx_commit=1
#Thesizeofthebuffe≈rInnoDBusesforbufferinglogd≠©ata.Assoonas
#itisfull,InnoDBwill↑£havetoflushittodisk.Asitisflu≠→shed
#oncepersecondanyway,itdoesnotmakese™♥≠δnsetohaveitverylarge
#(evenwithlongtran♥£ ↑sactions).
這(zhè)個(gè)大(dà)小(xiπ₩ǎo)用(yòng)于緩沖InnoDB在緩沖日(r₹¶Ωì)志(zhì)數(shù)據。一(yī)旦它滿了(le∏),InnoDB會(huì)在磁盤上(shàng)釋放( ααfàng)它。
它無論如(rú)何都(dōu)會(huì)一(yī)秒(γ®∞γmiǎo)緩沖一(yī)次,這(zhè)對(duì)于非常大(dà)的(d≈e)日(rì)志(zhì)是(shì)沒有(yǒu)意義的(de)。≤¥(即使有(yǒu)長(cháng)事(shì)務)
innodb_log_buffer_size=λ ♣1M
#InnoDB,unlikeMyISAM,usesabufferpβ☆ •ooltocachebothindexesand
#rowdata.Thebiggeryous↔♥≤etthisthelessdiskI/Oisneed↕edto
#accessdataintables.Onadedi©✘£↔cateddatabaseserveryoumaysetthis
#parameterupto80%ofthemachinephy♥≠sicalmemorysize.Donotsetit
#toolarge,though,becausecompetition>δofthephysicalmemoryma €y
#causepagingintheoperatingsystem.N≤ otethaton32bitsystems♦>you
#mightbelimitedto☆β•♦2-3.5Gofuserlevelmemoryperprocess,sodo>®×not
#setittoohigh.
InnoDB,不(bù)像MyISAM,使用(yòng)一(yī£ )個(gè)緩沖池來(lái)緩存的(de)兩個(gè)索引和(h∞©é)行(xíng)數(shù)據。這(zhè)個(gè)磁♠✘"盤I/O設置的(de)更大(dà),需要(yào)訪問←≤(wèn)的(de)數(shù)據表更少(shǎo)。在專用(yòng↕±)的(de)數(shù)據庫服務器(qì)上(shàng)你(δ™"σnǐ)可(kě)以設置參數(shù)高(gāo)達80%的('✔↑★de)機(jī)器(qì)的(de)物(wù)理(Ω✔lǐ)內(nèi)存大(dà)小(xiǎo)。不(bù)用(yò≠ εng)把它設置的(de)太大(dà),不(bù)過,因為(ε♠wèi)在操作(zuò)系統中競争的(de)物(wù)理(lǐ×←↕)內(nèi)存可(kě)能(néng)導緻內(nèi)存不(bù)¥↑夠分(fēn)。注意,32位系統上(shàng)的(d≥₽γe)你(nǐ)可(kě)能(néng)被限制(zhì)在2-₽↔3.5g的(de)用(yòng)戶級內(nèi)存,λ>γ所以不(bù)要(yào)設置的(de)太高(gāo)。
innodb_buffer_pool_siz≠↓©∏e=83M
#Sizeofeachlogfileinaloggroup.You™shouldsetthecombinedsize
#oflogfilestoabout25%-100%✘←ofyourbufferpoolsizetoavoid
#unneededbufferpoolflushactivi₽'®tyonlogfileoverwrite.However,
#notethatalargerlogfilesizewil'γ÷lincreasethetimeneededfort≤§he
#recoveryprocess.
每個(gè)日(rì)志(zhì)文(wén)件(φαjiàn)在日(rì)志(zhì)組裡(lǐ)的(de)大(÷β÷dà)小(xiǎo)。你(nǐ)應該将日(rì)志(zh♠÷₽₹ì)文(wén)件(jiàn)大(dà)約為(wèi)25%--100%緩λ$π沖池大(dà)小(xiǎo)合并來(lái)避π•&Ω免不(bù)必要(yào)的(de)緩沖池的(de)緩沖行(♦γ♥xíng)為(wèi)覆蓋日(rì)志(zhì)文(wén)件(jiànδ✔ε )。然而,一(yī)個(gè)大(dà)的(♣£πde)日(rì)志(zhì)文(wén)件(jià§"♠n)将增加複蘇過程的(de)所需時(shí)間(j£₹iān)。
innodb_log_file_size=1<≥7M
#NumberofthreadsallowedinsidetheInn $γ±oDBkernel.Theoptimalvalue
#dependshighlyonthea≥→↔ pplication,hardwareas±¥↔wellastheOS
#schedulerproperties.Atooh←×∏γighvaluemayleadtothreadthrashin×φ≠g.
InnoDB的(de)內(nèi)核允許多(duō)線程。最高←δ♦¶(gāo)性能(néng)取決于高(gāo)的(de)應用(σε♣yòng)程序、硬件(jiàn)以及操作(zuò)系統。
一(yī)個(gè)很(hěn)高(gāo)的(de)∏★值可(kě)能(néng)導緻線程抖動
innodb_thread_con♠₹×currency=8
- 歡迎大(dà)家(jiā)閱讀(dú)浏覽,部分(fēn)內(nè≈→∑i)容來(lái)源于網絡,如(rú)有(y≈¥ βǒu)侵權,請(qǐng)聯系我們删除!
- 上(shàng)一(yī)條:5.18日(rì)音(yīn)訊,Mysql的(de)亂碼詳解
- 下(xià)一(yī)條:5.20日(rì)音(yīn)訊,即插即用(yòng)φ™的(de)基本要(yào)求
服務項目
熱(rè)門(mén)信息
- 邯鄲網絡公司:模闆建站(zhàn)的(de)好(hǎo)處有(yǒu)哪些(§↕xiē)?
- 3642024-04-25

- 4.9日(rì)訊,企業(yè)網站(zhàn)建設如(rú)☆↑何發揮網絡營銷功能(néng)?
- 4092024-04-09

- 邯鄲網絡公司:外(wài)貿網站(zhàn)制(zhì)™±¶∑作(zuò)的(de)8個(gè)步驟
- 3772024-03-05

- 簡單3步,輕松做(zuò)企業(yè)官網
- 6822024-02-18
