Tải bản đầy đủ

OReilly MySQL in a nutshell may 2005 ISBN 0596007892

MySQLinaNutshell
ByRussellDyer
...............................................
Publisher:O'Reilly
PubDate:May2005
ISBN:0-596-00789-2
Pages:352

TableofContents|Index|Errata

MySQListheworld'smostpopularopensourcedatabase.MySQLisdesignedfor
speed,power,andflexibilityinmission-critical,heavy-useenvironmentsandmodest
applicationsaswell.It'salsosurprisinglyrichinfeatures.Ifyou'readatabase
administratororprogrammeryouprobablylovethemyriadofthingsMySQLcando,
butsometimeswishtherewasn'tsuchamyriadofthingstoremember.WithMySQL
inaNutshellbyyourkeyboard,youcandrilldownintothefulldepthofMySQL's
capabilitiesquicklyandeasily.
MySQLinaNutshellistheindispensabledesktopreferencetoallMySQLfunctions.
ProgramminglanguageAPIsforPHP,Perl,andCarecovered,aswellasallthe
popularMySQLutilities.
Thisinvaluableresourceclearlydocumentsthedetailsthatexperiencedusersneedto

takefulladvantageofthispowerfuldatabasemanagementsystem.Betteryet,this
wealthofinformationispackedintotheconcise,comprehensive,andextraordinarily
easy-to-useformatforwhichtheinaNutshellguidesarerenowned.
InadditiontoprovidingathoroughreferencetoMySQLstatementsandfunctions,the
administrativeutilities,andthemostpopularAPIs,MySQLinaNutshellincludes
severaltutorialchapterstohelpnewcomersgetstarted.Moreover,eachchapter
coveringanAPIbeginswithabrieftutorialsothat,regardlessofyourlevelof
experienceinanygivenarea,youwillbeabletounderstandandmasterunfamiliar
territory.
MySQLinaNutshelldistillsallthevitalMySQLdetailsyouneedonadailybasis
intooneconvenient,well-organizedbook.Itwillsaveyouhundredsofhoursof
tediousresearchortrialanderrorandputthefactsyouneedtotrulytapMySQL's


capabilitiesatyourfingertips.


MySQLinaNutshell
ByRussellDyer
...............................................
Publisher:O'Reilly
PubDate:May2005
ISBN:0-596-00789-2
Pages:352

TableofContents|Index|Errata



Dedication



Copyright



Preface



ThePurposeofThisBook



HowThisBookIsOrganized



ConventionsUsedinThisBook



UsingCodeExamples



RequestforComments



SafariEnabled



Acknowledgments



Chapter1.IntroductiontoMySQL



Section1.1.TheValueofMySQL



Section1.2.TheMySQLPackage



Section1.3.Licensing



Section1.4.MailingLists



Section1.5.BooksandOtherPublications



Chapter2.InstallingMySQL



Section2.1.ChoosingaDistribution



Section2.2.UnixSourceDistributions



Section2.3.UnixBinaryDistributions



Section2.4.LinuxRPMDistributions



Section2.5.MacintoshOSXDistributions



Section2.6.NovellNetWareDistributions



Section2.7.WindowsDistributions



Section2.8.Postinstallation



Chapter3.MySQLBasics



Section3.1.ThemysqlClient



Section3.2.CreatingaDatabaseandTables



Section3.3.ShowMe




Section3.4.InsertingData



Section3.5.SelectingData



Section3.6.Ordering,Limiting,andGrouping



Section3.7.AnalyzingandManipulatingData



Section3.8.ChangingData



Section3.9.DeletingData



Section3.10.SearchingData



Section3.11.ImportingDatainBulk



Section3.12.Command-LineInterface







Section3.13.Conclusion
Chapter4.SQLStatements
Section4.1.StatementsGroupedbyType
Section4.2.StatementsandClausesinAlphabeticalOrder
Chapter5.StringFunctions



Section5.1.StringFunctionsGroupedbyType



Section5.2.StringFunctionsinAlphabeticalOrder



Chapter6.DateandTimeFunctions



Section6.1.DateandTimeFunctionsGroupedbyType



Section6.2.DateandTimeFunctionsinAlphabeticalOrder









Chapter7.MathematicalandAggregateFunctions
Section7.1.FunctionsinAlphabeticalOrder
Chapter8.FlowControlFunctions
Section8.1.FunctionsinAlphabeticalOrder
Chapter9.MiscellaneousFunctions
Section9.1.FunctionsinAlphabeticalOrder
Chapter10.MySQLServerandClient



mysql



mysqld



mysqld_multi




mysqld_safe
Chapter11.Command-LineUtilities



comp_err



isamchk



make_binary_distribution



msql2mysql



my_print_defaults



myisamchk



myisamlog



myisampack



mysqlaccess



mysqladmin



mysqlbinlog



mysqlbug



mysqlcheck



mysqldump




mysqldumpslow



mysqlhotcopy



mysqlimport



mysqlshow




perror
Chapter12.PerlAPI



Section12.1.UsingPerlDBIwithMySQL



Section12.2.PerlDBIMethodandFunctionReference



Section12.3.AttributesforHandles



Chapter13.PHPAPI



Section13.1.UsingPHPwithMySQL



Section13.2.PHPMySQLFunctionsinAlphabeticalOrder



Chapter14.CAPI



Section14.1.UsingCwithMySQL



Section14.2.FunctionsinAlphabeticalOrder



Section14.3.CAPIDatatypes



AppendixA.Datatypes



SectionA.1.NumericDatatypes



SectionA.2.AccurateNumericTypes



SectionA.3.ApproximateNumericDatatypes



SectionA.4.DateandTimeDatatypes



SectionA.5.StringDatatypes



AppendixB.Operators



SectionB.1.ArithmeticOperators



SectionB.2.RelationalOperators



SectionB.3.LogicalOperators



SectionB.4.BitwiseOperators



AppendixC.EnvironmentVariables



Colophon



Index


Dedication
TomyfriendRichardStringer,forencouragingmeinliterature,liberalism,
andwriting,andforhelpingmetobecomethepersonIwasmeanttobe.
-RussellJ.T.Dyer


Copyright©2005O'ReillyMedia,Inc.Allrightsreserved.
PrintedintheUnitedStatesofAmerica.
PublishedbyO'ReillyMedia,Inc.,1005GravensteinHighwayNorth,
Sebastopol,CA95472.
O'Reillybooksmaybepurchasedforeducational,business,orsalespromotional
use.Onlineeditionsarealsoavailableformosttitles(http://safari.oreilly.com).
Formoreinformation,contactourcorporate/institutionalsalesdepartment:(800)
998-9938orcorporate@oreilly.com.
NutshellHandbook,theNutshellHandbooklogo,andtheO'Reillylogoare
registeredtrademarksofO'ReillyMedia,Inc.TheInaNutshellseries
designations,MySQLinaNutshell,theimageofapiedkingfisher,andrelated
tradedressaretrademarksofO'ReillyMedia,Inc.
Manyofthedesignationsusedbymanufacturersandsellerstodistinguishtheir
productsareclaimedastrademarks.Wherethosedesignationsappearinthis
book,andO'ReillyMedia,Inc.wasawareofatrademarkclaim,thedesignations
havebeenprintedincapsorinitialcaps.
Whileeveryprecautionhasbeentakeninthepreparationofthisbook,the
publisherandauthorsassumenoresponsibilityforerrorsoromissions,orfor
damagesresultingfromtheuseoftheinformationcontainedherein.


Preface
MySQListhemostpopularopensourcedatabasesystemavailable.Althoughit's
free,it'sstillverydependableandfast,andisbeingemployedincreasinglyin
areasthatusedtobetheprovinceofOracleorMSSQLServer.Thankstoa
varietyofutilitiespackagedwithMySQL,administrationisfairlyeffortless.And
withitsseveralapplicationprogramminginterfaces(APIs),it'seasytodevelop
yourownsoftwaretointerfacewithMySQL.
ThisbookprovidesaquickreferencetoMySQLstatementsandfunctions,the
administrativeutilities,andthemostpopularAPIs.Thefirstfewchaptersare
designedtohelpyougetstartedwithMySQL.EachchapteronanAPIalsostarts
withatutorial.
Whenthisbookwaswritten,Version4.1ofMySQLwasreleased,andearly
releasesofthedevelopmentVersionof5.0wereavailablebutnotyetstable.Asa
result,youwillfindmostlyfeaturesfromVersion4.x,alongwithsomefrom
Version5.x,inthisbook.Featuresthatappearonlyinnewerversionsarenoted
assuch.


ThePurposeofThisBook
Thepurposeofthisbookistoprovideaquickreferenceto:
MySQLstatementsandfunctions
ThemostpopularAPIsusedtoaccessMySQLdatabases
Command-lineoptionsandconfigurationinformationfortheMySQL
serverandutilities
Severalchaptersstartwithtutorials,butthecentralpurposeofthebookistofill
inthegapsforpeoplewhoarealreadycomfortablewithrelationaldatabases.
TheformatthatI'vefollowedforadescriptionofeachstatementorfunctionisto
movefromcurtmemory-joggerstomoreleisurelyexplanations.Ifyouknowthe
functionthatyou'relookingup,butcan'tquiterememberthesyntax,you'llfind
thatfirst.Ifyouneedabitmoreinformationtojogyourmemoryortoclarifythe
possibilitiesavailablewiththefunction,youcanfindthisinthefirstsentenceor
sooftheexplanation.Ifyourequiremoreclarificationconcerningafunction's
use,youcancontinuewiththeslower-pacedmaterialthatfollows.Examplesof
usageareprovidedformostfunctions.
Insummary,thegoalistobebriefbutfairlycomplete,andtoincreasethelevel
ofdetailasyoureadon.


HowThisBookIsOrganized
Thisbookisbrokenupintofourteenchaptersandthreeappendixes,asfollows:
Chapter1,explainsthemajorcomponentsofMySQLandusefulguidelinesfor
gettinginformationanddealingwiththeMySQLcommunity.
Chapter2,describeshowtogetMySQLrunningonallthesystemssupportedby
MySQLAB.Itisnecessarytoreadthischapteronlyifyoursystemdoesnot
alreadyhaveMySQLinstalled.
Chapter3,introducesSQLanduseofthemysqlcommand-lineutility.Itisno
replacementforlearningSQLandrelationaldatabasedesign,butcanbeuseful
toorientyou.
Chapter4,isthemajorchapterinthisbook,acomprehensivelistingofallSQL
statementssupportedbyMySQLandtheirsubclauses.
Chapter5,coversSQLfunctionsformanipulatingtextdata.
Chapter6,coversSQLfunctionsthatmanipulatethevariousdataandtime
formatssupportedbyMySQL.
Chapter7,coversmathematicalSQLfunctionsandfunctionsusedforcombining
informationincolumns,suchasMAX()andCOUNT().
Chapter8,coversSQLfunctions,suchasCASEandIF.
Chapter9,coversSQLfunctionsthatcanbeusedtocontrolorgetinformation
aboutthedatabaseengine,anddoothermiscellaneoustasks.
Chapter10,coverstheoptionsforthemysqlddaemon,themysqlcommand-line
client,andrelatedcommands.
Chapter11,coversothercommandsforadministeringMySQLanditsdata.
Chapter12presentsthePerlDBImodule,usedtoaccessMySQLdatabasesfrom


Perl.
Chapter13,presentsthePHPfunctionsusedtoqueryandmanipulateMySQL
databases.
Chapter14,coversthedatatypesandfunctionsprovidedbyMySQL'sbasicC
library.
AppendixA,listsallthedatatypessupportedbyMySQL.
AppendixB,listsallMySQLoperators,suchasarithmeticsignsandtheLIKE
andISNULLcomparisonoperators.
AppendixC,liststheoperatingsystem'senvironmentvariablesconsultedbythe
MySQLserver,client,andotherutilities.


ConventionsUsedinThisBook
Thefollowingtypographicalconventionsareusedinthisbook:

Plaintext
Indicatesmenutitles,menuoptions,menubuttons,andkeyboard
accelerators(suchasAltandCtrl).

Italic
Indicatesnewterms,URLs,emailaddresses,usernames,hostnames,
filenames,fileextensions,pathnames,directories,andutilities.

Constantwidth
Indicateselementsofcode,configurationoptions,variables,functions,
modules,thecontentsoffiles,ortheoutputfromcommands.

Constantwidthbold
Showscommandsorothertextthatshouldbetypedliterallybytheuser.

Constantwidthitalic
Showstextthatshouldbereplacedwithuser-suppliedvalues.


UsingCodeExamples
Thisbookisheretohelpyougetyourjobdone.Ingeneral,youmayusethe
codeinthisbookinyourprogramsanddocumentation.Youdonotneedto
contactusforpermissionunlessyou'rereproducingasignificantportionofthe
code.Forexample,writingaprogramthatusesseveralchunksofcodefromthis
bookdoesnotrequirepermission.SellingordistributingaCD-ROMof
examplesfromO'Reillybooksdoesrequirepermission.Answeringaquestionby
citingthisbookandquotingexamplecodedoesnotrequirepermission.
Incorporatingasignificantamountofexamplecodefromthisbookintoyour
product'sdocumentationdoesrequirepermission.
Weappreciate,butdonotrequire,attribution.Anattributionusuallyincludesthe
title,author,publisher,andISBN.Forexample:"MySQLinaNutshellby
RussellJ.T.Dyer.Copyright2005O'ReillyMedia,Inc.,0-596-00789-2."
Ifyoufeelyouruseofcodeexamplesfallsoutsidefairuseorthepermission
givenabove,feelfreetocontactusatpermissions@oreilly.com.


RequestforComments
Pleaseaddresscommentsandquestionsconcerningthisbooktothepublisher:
O'ReillyMedia,Inc.
1005GravensteinHighwayNorth
Sebastopol,CA95472
(800)998-9938(intheUnitedStatesorCanada)
(707)829-0515(internationalorlocal)
(707)829-0104(fax)
Theexamplesinthisbookareprofessionallywrittenandhavebeentested,but
thatdoesnotmeanthattheyareguaranteedtobebug-freeortoworkcorrectly
withyourversionandyourplatform'simplementationofMySQL2.1.Ifyou
haveproblems,findbugs,orhavesuggestionsforfutureeditions,pleaseemail
themto:
bookquestions@oreilly.com
There'sawebpageforthisbookthatlistserrata,examples,andanyadditional
information.Youcanaccessthispageat:
http://www.oreilly.com/catalog/mysqlian
Formoreinformationaboutbooks,conferences,ResourceCenters,andthe
O'ReillyNetwork,seetheO'Reillywebsiteat:
http://www.oreilly.com


SafariEnabled

WhenyouseeaSafari®Enabledicononthecoverofyourfavorite
technologybook,thatmeansthebookisavailableonlinethroughtheO'Reilly
NetworkSafariBookshelf.
Safarioffersasolutionthat'sbetterthane-books.It'savirtuallibrarythatlets
youeasilysearchthousandsoftoptechbooks,cutandpastecodesamples,
downloadchapters,andfindquickanswerswhenyouneedthemostaccurate,
currentinformation.Tryitforfreeathttp://safari.oreilly.com.


Acknowledgments
ThankstoAndyOram,myeditor,forhisguidanceandediting,andforhelping
metobethepersonfortunateenoughtowritethisbook.ThanksalsotoKasia
Trapszo,RickRezinas,andothersforreviewingthemanuscriptfortechnical
accuracy.Theirassistanceisgreatlyappreciated.Ialsoappreciatethechances
thatRikkiEndsley(editorofUnixReview)tookwithmeatthestartofmy
writingcareer,andthehelpthatshe,chromatic(editorofONLamp.com),and
severalothermagazineseditorsgavemeindevelopingmyskills.Specialthanks
toKathrynBarrett(publicistforO'Reilly)forhermoralsupportandadviceover
thepastcoupleofyears.Finally,thankstomyfriendsRustyOsbornefor
listeningtomethroughitallandMichaelZabalaouiforbuyingmelunchalmost
everyweekdaywhileIworkedonthisbookinlieuofaregularjob.


Chapter1.IntroductiontoMySQL
MySQLisanopensource,multithreaded,relationaldatabasemanagement
systemcreatedbyMichael"Monty"Wideniusin1995.In2000,MySQLwas
releasedunderadual-licensemodelthatpermittedthepublictouseitforfree
undertheGNUPublicLicense(GPL);thiscauseditspopularitytosoar.The
companythatownsanddevelopsMySQLisMySQLAB(theABstandsfor
aktiebolag,orstockcompany).Currently,MySQLABestimatesthatthereare
morethan4millioninstallationsofMySQLworldwide,andreportsanaverage
of35,000downloadsadayofMySQLinstallationsoftwarefromitssiteand
frommirrorsites.ThesuccessofMySQLasaleadingdatabaseisduenotonlyto
itspriceafterall,othercost-freeandopensourcedatabasesareavailablebutalso
itsreliability,performance,andfeatures.


1.1.TheValueofMySQL
ManyfeaturescontributetoMySQL'sstandingasasuperbdatabasesystem.Its
speedisoneofitsmostprominentfeatures.InacomparisonbyeWEEKof
severaldatabasesincludingMySQL,Oracle,MSSQL,IBMDB2,andSybase
ASEMySQLandOracletiedforbestperformanceandforgreatestscalability
(seehttp://www.mysql.com/it-resources/benchmarksformoredetails).Fora
databaselongdismissedbymanypeople,MySQLisremarkablyscalable,andis
abletohandletensofthousandsoftablesandbillionsofrowsofdata.Plus,it
managessmallamountsofdataquicklyandsmoothly.
Thestorageengine,whichmanagesqueriesandinterfacesbetweenauser'sSQL
commandsandthedatabase'sbackendstorage,isthecriticalsoftwareinany
databasemanagementsystem.MySQLoffersseveralstorageenginespreviously
calledtabletypeswithdifferentadvantages.Somearetransaction-safestorage
enginesthatallowforrollbackofdata.Additionally,MySQLhasatremendous
numberofbuilt-infunctionsthataredetailedinseveralchaptersofthisbook.
MySQLisalsoverywell-knownforrapidandstableimprovements.Whenever
youvisitMySQLAB'ssitetodownloadMySQL,youwillseeastablerelease
thathasbeenthoroughlytested.Youwillalsoseeadistributionthathas
undergonetesting,butcontainscomponentsthathavenotbeentestedas
thoroughlyasthestandardversion.Thisversioncontainseverythinginthelatest
standardversionplusnewfeaturesthateventuallywillberolledintothestandard
version.Eachnewreleasecomeswithspeedandstabilityimprovements,aswell
asnewfeatures.


1.2.TheMySQLPackage
TheMySQLpackagecomeswithseveralprograms.ForemostistheMySQL
server,representedbythemysqlddaemon.Thedaemonlistensforrequestsona
particularport(3306bydefault)bywhichclientssubmitqueries.Thestandard
MySQLclientprogramissimplycalledmysql.Withthistext-basedinterface,a
usercanloginandexecuteSQLqueries.Thisclientcanalsoacceptqueriesfrom
textfilescontainingqueries,andtherebyexecutethemonbehalfoftheuseror
othersoftware.However,mostMySQLuseisdonebyprogramsusingavariety
oflanguages.TheinterfacesforPerl,PHP,andCarediscussedinthisbook.
AfewwrapperscriptsformysqldcomewithMySQL.Themysqld_safe
scriptisthemostcommonwaytostartmysqld,becausethescriptcanrestartthe
daemonifitcrashes.Thishelpsensureminimaldowntimefordatabaseservices.
Thescriptmysqld_multiisusedtostartmultiplesessionsof
mysqld_safe,andtherebymultiplemysqldinstances,forhandlingrequests
fromdifferentportsanddifferentUnixsocketfiles,andtomakeiteasiertoserve
differentsetsofdatabases.ForMSWindowsNTand2000servers,there's
mysqld-nt.ItsupportsthenamedpipesthatsomeWindowssystemsuse
insteadofsocketfiles.
MySQLalsocomeswithavarietyofutilitiesformanagingaMySQLserver.
mysqlaccessisusedforcreatinguseraccountsandsettingtheirprivileges.
mysqladmincanbeusedtomanagetheMySQLserveritselffromthecommand
line.Thisinteractionincludescheckingaserver'sstatusandusage,andshutting
downaserver.mysqlshowmaybeusedtoexamineaserver'sstatus,aswellas
informationaboutdatabasesandtables.SomeoftheseutilitiesrequirePerl,or
ActivePerlforWindows,tobeinstalledontheserver.Seehttp://www.perl.orgto
downloadandinstallacopyofPerlonnon-Windowssystems,and
http://www.activestate.com/Products/ActivePerltodownloadandinstallacopy
ofActivePerlonWindowssystems.
MySQLalsocomeswithafewutilitiesforimportingandexportingdatafrom
andtoMySQLdatabases.mysqldumpisthemostpopularforexportingdataand
tablestructurestoaplain-textfileknownasadumpfile.Thiscanbeusedfor


backingupdataorformanuallymovingitbetweenservers.Themysqlclientcan
beusedtoimportthedatabacktoMySQLfromadumpfile.
mysqlhotcopycanalsobeusedtobackupadatabaseorspecifictables.It'smore
effectiveatdataconsistencybetweentablesthanmysqldump,becauseitlocks
thetablesautomatically.Theresultingbackupfilesareready-to-usecopiesofthe
databasesintheformatMySQLuses.Torestorethem,youcanjustcopythemto
MySQL'sdatadirectory.
ForimportingdataintoMySQLfromanexternalfilethatwasexportedina
commondatabaseformat,MySQLprovidesmysqlimport.


1.3.Licensing
AlthoughMySQLcanbeusedforfreeandisopensource,MySQLABholdsthe
copyrightstothesourcecode.Thecompanyoffersadual-licensingprogramfor
itssoftware:oneallowscost-freeusethroughtheGPLundercertaincommon
circumstances,andtheotherisacommerciallicensebearingafee.They'reboth
thesamesoftware,buteachhasadifferentlicenseanddifferentprivileges.See
http://www.fsf.org/licensesformoredetailsontheGPL.
MySQLABallowsyoutousethesoftwareundertheGPLifyouuseitwithout
redistributingit,orifyouredistributeitonlywithsoftwarelicensedunderthe
GPL.YoucanevenusetheGPLifyouredistributeMySQLwithsoftwarethat
youdeveloped,aslongasyoudistributeyoursoftwareundertheGPLaswell.
However,ifyouhavedevelopedanapplicationthatrequiresMySQLforits
functionalityandyouwanttosellyoursoftwarewithMySQLunderanonfree
license,youmustpurchaseacommerciallicensefromMySQLAB.Thereare
otherscenariosinwhichacommerciallicensemayberequired.Fordetailson
whenyoumustpurchasealicense,see
http://www.mysql.com/company/legal/licensing.
Besidesholdingthesoftwarecopyrights,MySQLABalsoholdstheMySQL
trademark.Asaresult,youcannotdistributesoftwarethatincludesMySQLin
thename.


1.4.MailingLists
YoucanreceivesomeassistancewithproblemsthatyoumayhavewithMySQL
fromtheMySQLcommunityatnochargethroughseverallistservemailsystems
hostedbyMySQLAB.ThereisamainmailinglistforMySQL(mysql)and
severalspecializedmailinglistswhereanyonecanpostamessageforhelpona
particulartopic.Onelistcoversquestionsaboutdatabaseperformance
(benchmarks).AnotherisforquestionsontheWindowsversionsofMySQL
(win32).TherearealsolistsforproblemsconcerningtheJavaJDBCdrivers
(java)andforthePerlDBImodule(perl).
Foracompletelistingortosubscribetooneormoreofthesemailinglists,goto
http://lists.mysql.com.Onthismailinglistpage,youwillfindlinksfor
subscribingtoeachlist.Whenyouclickasubscriptionlink,youwillseeavery
simpleformonwhichtoenteryouremailaddress.Somesubscribers,
incidentally,liketouseaspecialemailaddressandnamerepresentingtheir
onlinepersona.Itallowsyouanonymityandmaymakesortingemailseasier.
Others,however,prefertousetheirrealnameandcontactinformation.Afteryou
enteryouremailaddress,youwillreceiveanautomatedmessagetoconfirm
youraddress.ThatemailwillhavealinktotheMySQLsitewithsome
parametersidentifyingyouraddress.Clickthelink,anditwillopenyourweb
browserandconfirmyoursubscription.
Thepagefromwhichyoucansubscribetoalistalsohaslinksforunsubscribing
fromlists,aswellaslinkstoarchivesofpreviouslistservmessagesforeachlist.
Youcansearchthesearchivesformessagesfromotherswhoaredescribingthe
sameproblemthatyouaretryingtoresolve.It'salwaysagoodideatosearch
archivesbeforepostinganythingofyourown,tofindoutwhetheryourtopichas
beendiscussedbefore.Ifyoucan'tfindasolutioninthedocumentationavailable
toyouorinthearchives,youcanpostamessagetoaparticularmailinglistby
sendinganemailtothatlistonlists.mysql.com.Forexample,ifyouhavea
problemwiththePerlDBImoduleinrelationtoMySQL,youwouldsenda
messagetoperl@lists.mysql.com.Justbesuretosendthemessagefromthe
emailaccountthatisregisteredwiththelisttowhichyou'resubmittingyour
question.


1.5.BooksandOtherPublications
Besidesthemailinglistarchivesmentionedinthelastsection,MySQLAB
providesextensiveonlinedocumentationoftheMySQLserverandallofthe
othersoftwareitdistributes.Youcanfinddocumentationat
http://dev.mysql.com/doc.Youcanreadthematerialonlineordownloaditina
coupleofformats(e.g.,HTMLorPDF).Itisalsoavailableinhardcopyformat:
MySQLLanguageReferenceandMySQLAdministrator'sGuide,bothfrom
MySQLPress.
Inadditiontothisbook,O'ReillyMediapublishesafewotherbooksonMySQL
worthbuyingandreading.O'Reilly'smainlineMySQLbookisManaging&
UsingMySQL(2002)byGeorgeReese,RandyJayYarger,andTimKing(with
HughE.Williams).GeorgeReesehascompiledasmallerversioncalledMySQL
PocketReference(2003).Forcommonpracticalproblemsolving,there'sMySQL
Cookbook(2002)byPaulDuBois.ForadviceonoptimizingMySQLand
performingadministrativetasks,suchasbackingupdatabases,O'Reillyhas
publishedHighPerformanceMySQL(2004)byJeremyD.ZawodnyandDerek
J.Balling.
O'ReillyalsopublishesseveralbookswithregardtotheMySQLapplication
programminginterfaces(APIs).ForPHPdevelopmentwithMySQL,there'sWeb
DatabaseApplicationswithPHPandMySQL(2004)byHughE.Williamsand
DavidLane.ForinterfacingwithPerltoMySQLandotherdatabasesystems,
there'sProgrammingthePerlDBI(2000)byAlligatorDescartesandTim
Bunce.TointerfacetoMySQLwithJava,youcanusetheJDBCandJConnector
driversandGeorgeReese'sbook,DatabaseProgrammingwithJDBCandJava
(2002).
InadditiontopublishedbooksonMySQL,afewwebsitesofferbrieftutorials
onusingMySQLtopics.TheO'ReillyNetworkoftenpublishesarticleson
MySQLandtheAPIsforPerl,PHP,andPythoninitsonlinepublication
ONLamp.com(http://www.onlamp.com/onlamp/general/mysql.csp).
Incidentally,I'vecontributedafewarticlestothatpublicationonMySQLand
relatedtopics.I'vealsowrittenmanyarticlesonMySQLformycolumnonUnix
Review.com(http://www.unixreview.com/mysql).MySQLABalsoprovides


somein-deptharticlesonMySQL.Youcanfindthemat
http://dev.mysql.com/tech-resources/articles.Manyofthesearticlesdealwith
newproductsandfeatures,makingthemidealifyouwanttolearnaboutusing
thelatestreleasesavailableevenwhilethey'restillinthetestingstages.
DeveloperShed(http://www.devarticles.com/c/b/MySQL)andWebMonkey
(http://search.hotwired.com/webmonkey/?query=mysql)areadditional
educationalresources.Alloftheseonlinepublicationsaresubscription-free.


Chapter2.InstallingMySQL
TheMySQLdatabaseserverandclientsoftwareworkonseveraldifferent
operatingsystems,notablyLinux,FreeBSD,andawiderangeofUnixsystems:
SunSolaris,IBMAIX,HP-UX,andsoon.MySQLABhasalsodevelopeda
MacOSXversion,aNovellNetWareversion,andseveralMSWindows
versions.YoucanobtainacopyofMySQLfromMySQLAB'ssite
(http://dev.mysql.com/downloads)orfromoneofitsmirrorsites
(http://dev.mysql.com/downloads/mirrors.html).
ThischapterbrieflyexplainstheprocessofinstallingMySQLonUnix,Linux,
MacOSX,NetWare,andWindowsoperatingsystems.Forsomeoperating
systemsthereareadditionalsectionsfordifferentdistributionformats.Forany
oneplatform,youcaninstallMySQLbyreadingjustthreesectionsofthis
chapter:thenextsection,Section2.1;thesectionthatappliestothedistribution
thatyouchoose;andtheSection2.8attheendofthechapter.


Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Tải bản đầy đủ ngay

×

×