新聞資訊
記錄首創點滴進步 見(jiàn)證遠(yuǎn)行(xíng)
我們一(yī)直緊跟時(shí)代前沿,↑"聚焦行(xíng)業(yè)實時(shí)動态,發布公司最新資訊β•£,歡迎您的(de)關注

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)聯系我們删除!

+ 查看(kàn)更多(duō)我們的(de)客戶 / Our client

首創簡介

    首創網絡成立于2012年(nián),是(shì)一(yī)家(jiā)α×‌σ專業(yè)的(de)品牌網站(zhàn)設計(jì)和(​>hé)網絡營銷推廣公司,服務領域涵蓋網站(zhàn)設計>'(jì)、市(shì)場(chǎng)策劃、企業(yè)畫(huà)冊及Vβ≥×I視(shì)覺設計(jì)、網站(zhàn)域名空(kōng‌≈)間(jiān)等領域,公司擁有(yǒu←ε≠)一(yī)批高(gāo)素質人(rén)才,著(zh★→♠→e)力打造品牌網站(zhàn)設計(jì)制(zhì)作(zuò)和(hé)∑∞網上(shàng)營銷策略執行(xíng)兩大(dà)優勢。∑®∏

    十年(nián)來(lái),憑借對(duì→₹↔<)市(shì)場(chǎng)趨勢敏銳的γ¥(de)洞察,和(hé)對(duì)消費(fèi)者、企≥ αφ業(yè)形态深刻的(de)理(lǐ)解,我們服務的(de)已遍及♦π京津冀、長(cháng)三角、珠三角等領域,行(xíng)業λ©(yè)覆蓋政府機(jī)構、企事(shì)業(yè)單δ☆位、無線通(tōng)訊、環保、電(diàn)♥♦™α子(zǐ)、醫(yī)藥、交通(tōng)、園林(lí♦ n)、地(dì)産等行(xíng)業(yè)¥±•,諸多(duō)知(zhī)名企業(yè),如(rα₩★ú)廣州京信集團、廣東(dōng)聯通(tōng)廣州分(fēn)公司、搜φ±∏‌狐家(jiā)居廣州站(zhàn)、搜狐家>≥(jiā)居邯鄲站(zhàn)等,都(dōu)鑒證了(le)首創設計(jì)公‍©™司的(de)品牌設計(jì)思想與能(néng)力,首創設計(jì)₽λφ公司也(yě)與諸多(duō)企業(yè)勃的(de)市(shì)場(chφ≠♠ǎng)經濟中互促共生(shēng)。

在線客服


  • 掃描加微(wēi)信

  • 掃描加QQ

  • 掃描浏覽手機(jī)版
首創網絡邯鄲公司
邯鄲公司
服務熱(rè)線:0310-4559740 / 18931045623 ÷¶ 公司地(dì)址:邯鄲市(shì)叢台區(qū)頤高(gāσ↑€o)廣場(chǎng)B座13層1304室 ​∏• 客戶接待:邯鄲市(shì)陵園路(lù)669号×✘康橋國(guó)際B06