116計算機(jī)專業(yè)相關(guān)有關(guān)畢業(yè)設(shè)計外文文獻(xiàn)翻譯成品安裝和配置mysql (最新)_第1頁
已閱讀1頁,還剩21頁未讀 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)

文檔簡介

1、<p>  此文檔是畢業(yè)設(shè)計外文翻譯成品( 含英文原文+中文翻譯),無需調(diào)整復(fù)雜的格式!下載之后直接可用,方便快捷!本文價格不貴,也就幾十塊錢!一輩子也就一次的事!</p><p>  外文標(biāo)題:Installing and Configuring MySQL</p><p>  外文作者:Frank M. Kromann</p><p>  文獻(xiàn)出處:B

2、eginning PHP and MySQL .2018: 521-541</p><p>  英文3292單詞,26587字符,中文5063漢字。</p><p>  Installing and Configuring MySQL</p><p>  Frank M. Kromann</p><p>  This chapter

3、 guides you through MySQL’s installation and configuration process. It is not intended as a replacement for MySQL’s excellent (and mammoth) user manual, but instead highlights the key procedures of immediate interest to

4、anybody who wants to quickly and efficiently ready the database server for use. The following topics are covered:</p><p>  ? Downloading instructions</p><p>  ? Distribution variations</p>

5、<p>  ? Installation procedures (source, binary, RPMs)</p><p>  ? Setting the MySQL administrator password</p><p>  ? Starting and stopping MySQL</p><p>  ? Installing MySQL

6、as a system service</p><p>  ? MySQL configuration and optimization issues</p><p>  ? Reconfiguring PHP to use MySQL</p><p>  By the chapter’s conclusion, you’ll have learned how to

7、 install and configure an operational MySQL server.</p><p>  Downloading MySQL</p><p>  Two editions of the MySQL database are available: MySQL Community Server and MySQL Enterprise Server. You

8、should use the former if you don’t require MySQL’s array of support, monitoring, and priority update services. If any or all of the aforementioned services might appeal to you, learn more about MySQL Enterprise at ht t p

9、s: / / www. mysql . com/ pr oduct s/ ent er pr i se. This book presumes you’re using the Community Server edition, which is available for free download via the MySQL website.</p><p>  If you’re running Linux

10、 or OS X, I strongly recommend installing MySQL using your distribution’s package manager. Otherwise, you can install MySQL using available RPMs or the source code from ht t ps: / / www. MySQL. com. I’ll guide you throug

11、h the process of installing MySQL from both RPM and source later in this chapter.</p><p>  MySQL offers a wide range of packages for download, ranging from the server package to cluster versions and bundled

12、tools to use on Windows for development or production environments. If you go to ht t ps: / / dev. mysql . com/ downl oads you can see a full list of the available packages. Similar you can go to ht t ps: / / mar i adb.

13、com/ downl oads/ to download the current version of MariaDB.</p><p>  Installing MySQL</p><p>  Database server installation can often be a painful process. Fortunately, MySQL server installatio

14、n is fairly trivial. In fact, after a few iterations, you’ll find that future installations or upgrade sessions will take just a few minutes to complete and can even be done by memory.</p><p>  In this secti

15、on, you’ll learn how to install MySQL on both the Linux and Windows platforms. In addition to offering comprehensive step-by-step installation instructions, topics that often confuse both newcomers and regular users alik

16、e are discussed, including distribution format vagaries, system-specific problems, and more.</p><p>  Throughout theremainder of this chapter, theconstant I NSTALL- DI Ris used as aplaceholder for MySQL’s ba

17、seinstallation directory. Consider modifying your systempath toincludethis directory.</p><p>  Installing MySQL on Linux</p><p>  Although MySQL has been ported to at least 10 platforms, its Lin

18、ux distribution remains the most popular. This isn’t surprising because Linux is commonly used in conjunction with running web-based services. This section covers the installation procedures for</p><p>  all

19、 three of MySQL’s available Linux distribution formats: RPM, binary, and source.</p><p>  In addition, it’s available through most Linux distributions package managers (yum, apt-get etc). This is usually the

20、 easiest and best way to install and manage the MySQL installation. There is no need to deal with compilers or manual installations.</p><p>  RPM, Binary, or Source?</p><p>  Software intended f

21、or the Linux operating system often offers several distribution formats. MySQL is no different, offering RPM, binary, and source versions of each released version. Because these are all popular options, this section offe

22、rs instructions for all three. If you’re new to these formats, take care to read each of these sections carefully before settling upon a format, and perform additional research if necessary.</p><p>  The RPM

23、 Installation Process</p><p>  If you’re running a RPM-driven Linux distribution, the RPM Package Manager (RPM) provides a simple means for installing and maintaining software. RPM offers a common command in

24、terface for installing, upgrading, uninstalling, and querying software, largely eliminating the learning curve historically required of general Linux software maintenance.</p><p>  Tip although you’ll learn

25、afew of r pM’s moreuseful and common commands in this section, it hardlyscratches thesurfaceof its capabilities. If you’reunfamiliar with r pMformat, you can learn moreabout it at www. rpm. or g.</p><p>  My

26、SQL offers RPMs for a variety of different processor architectures. To carry out the examples found throughout the remainder of this book, you need to download only the MySQL-server and MySQL-client packages. Download th

27、ese packages, saving them to your preferred distribution repository directory. It’s typical to store packages in the / usr / sr c directory, but the location has no bearing on the final outcome of the installation proces

28、s.</p><p>  Although the MySQL RPMs offer a painless and effective means to an end, this convenience comes at the cost of flexibility. For example, the installation directory is not relocatable; that is, you

29、 are bound to the predefined installation path as determined by the packager. This is not necessarily a bad thing, but the flexibility is often nice and sometimes necessary. If your personal situation requires that added

30、 flexibility, read on to find out about the binary and source installation processes.</p><p>  The Binary Installation Process</p><p>  Abinary distribution is simply precompiled source code, ty

31、pically created by developers or contributors with the intention of offering users a platform-specific optimized distribution. Although this chapter focuses on the Linux installation process, keep in mind that the proced

32、ure is largely identical for all platforms (many of which are available for download on the MySQL website) except for Windows, which is covered in the next section.</p><p>  To install the MySQL binary on Li

33、nux, you need to have tools capable of unzipping and untarring the binary package. Most Linux distributions come with the GNU gunzip and t ar tools, which are capable of carrying out these tasks.</p><p>  Yo

34、u can download the MySQL binary for your platform by navigating to the MySQL website’s Downloads section. Unlike the RPMs, the binaries come with both the server and client packaged together, so you need to download only

35、 a single package. Download this package, saving it to your preferred distribution repository directory. It’s common to store packages in the / usr / sr c directory, but the location has no bearing on the final outcome o

36、f the installation process.</p><p>  The Source Installation Process</p><p>  The MySQL developers have gone to great lengths to produce optimized RPMs and binaries for a wide array of operating

37、 systems, and you should use them whenever possible. However, if you are working with a platform for which no binary exists, require a particularly exotic configuration, or happen to be a rather controlling individual, t

38、hen you also have the option to install from source. The process takes only slightly longer than the binary installation procedure.</p><p>  That said, the source installation process is indeed somewhat more

39、 complicated than installing binaries or RPMs. For starters, you should possess at least rudimentary knowledge of how to use build tools like GNU gcc and make, and you should have them installed on your operating system.

40、 It’s assumed that if you’ve chosen to not heed the advice to use the binaries, you know all of this already. Therefore, just the installation instructions are provided, with no corresponding explanation:</p><

41、p>  1.Create the necessary group and owner:</p><p>  %>gr oupadd mysql</p><p>  %>user add –g mysql mysql</p><p>  2.Decompress the software to the intended directory. Usin

42、g the</p><p>  GNU gunzi p and t ar programs is recommended.</p><p>  %>cd / usr / sr c</p><p>  %>gunzi p < / usr / sr c/ mysql - VERSI ON. t ar . gz | t ar xvf -</p>

43、;<p>  %>cd mysql - VERSI ON</p><p>  3.Configure, make, and install MySQL. AC++ compiler and</p><p>  make program are required. Using recent versions of the GNU</p><p> 

44、 gcc and make programs is strongly recommended. Keep in</p><p>  mind that OTHER- CONFI GURATI ON- FLAGS is a placeholder for</p><p>  any configuration settings that determine several important

45、 characteristics of the MySQL server, such as installation location. It’s left to you to decide which flags best suit your special needs.</p><p>  %>. / conf i gur e –pr ef i x=/ usr / l ocal / mysql [ OT

46、HER- CONFI GURATI ON- FLAGS]</p><p><b>  %>make</b></p><p>  %>make i nst al l</p><p>  4.Copy the sample MySQL configuration (my. cnf ) file into its typical loca

47、tion and set its ownership. The role of this configuration file is discussed in depth later, in the “The my.cnf File” section.</p><p>  %>cp suppor t - f i l es/ my- medi um. cnf / et c/ my. cnf</p>

48、<p>  %>chown - R mysql .</p><p>  %>chgr p - R mysql .</p><p>  5.Install the MySQL database. mysql _i nst al l _db is a shell script</p><p>  that logs in to the MySQ

49、L database server, creates all of the</p><p>  necessary tables, and populates them with initial values.</p><p>  %>scr i pt s/ mysql _i nst al l _db - - user =mysql</p><p>  6.U

50、pdate the installation permissions:</p><p>  %>chown - R r oot .</p><p>  %>chown - R mysql dat a</p><p>  That’s it!Proceed to the “Setting the MySQL Administrator Password”

51、section.</p><p>  Installing and Configuring MySQL on Windows</p><p>  Open source products continue to make headway on the Microsoft Windows server platform, with historically predominant Unix-

52、based technologies like the Apache Web server, PHP, and MySQL gaining in popularity. In addition, for many users, the Windows environment offers an ideal development and testing ground for web/ database</p><p&

53、gt;  applications that will ultimately be moved to a production Linux environment.</p><p>  Installing MySQL on Windows</p><p>  As it is the case with the Linux version, it is possible to insta

54、ll both MySQL and MariaDB on a Windows system. Any version of Windows above 8 works fine. Both databases</p><p>  can be installed via MSI installation files. These will not only install and configure the ne

55、cessary files but also prompt the user to set a root password and perform other security settings.</p><p>  Although it is possible to install from source, it’s not recommended to do so. The installation pac

56、kages take care of security settings, and you do not need to have access to compilers and other build tools not normally installed on a Windows system.</p><p>  Start by downloading the MSI installation file

57、 from MySQL (ht t ps: / / dev. mysql . com/ downl oads/ mysql / ) or MariaDB (ht t ps: / / mar i adb. com/ downl oads/ mar i adb- t x). The two installers work slightly different based on the differences in the two produ

58、cts. Although they share the same root, they have evolved to include different options.</p><p>  Starting and Stopping MySQL The MySQL server daemon is controlled via a single program, located in the INSTALL

59、- DI R/ bi n directory. Instructions for controlling this daemon for both the Linux and Windows platforms are offered in this section.</p><p>  Controlling the Daemon Manually</p><p>  Although

60、you’ll ultimately want the MySQL daemon to automatically start and stop in conjunction with the operating system, you’ll often need to manually execute this process during the configuration and application testing stages

61、.</p><p>  Starting MySQL on Linux</p><p>  The script responsible for starting the MySQL daemon is called mysql d_saf e, which is located in the I NSTALL- DI R/ bi n directory. This script can

62、only be started by a user possessing sufficient execution privileges, typically either r oot or a member of the group mysql . The following is the command to start MySQL on Linux:</p><p>  %>cd I NSTALL-

63、DI R</p><p>  %>. / bi n/ mysql d_saf e - - user =mysql &</p><p>  Keep in mind that mysql d_saf e will not execute unless you first change to the I NSTALL- DI Rdirectory. In addition, th

64、e trailing ampersand is required because you’ll want the daemon to run in the background.</p><p>  The mysql d_saf e script is actually a wrapper around the mysqld server daemon, offering features that are n

65、ot available by calling mysqld directly, such as runtime logging and automatic restart in case of error. You’ll learn more about mysql d_saf e in the “Configuring MySQL” section.</p><p>  On modern versions

66、of Red Hat/ CentOS, the starting and stopping of the server is often done through a service manager like systemctl. The command to start, stop, and get the status for MariaDB looks like this:</p><p>  Starti

67、ng MySQL on Windows</p><p>  Presuming you followed the instructions from the earlier section “Configuring MySQL on Windows,” then MySQL has already been started and is running as a service. You can start an

68、d stop this service by navigating to your Services console, which can be opened by executing ser vi ces. msc from a command prompt.</p><p>  Stopping MySQL on Linux and Windows</p><p>  Although

69、 the MySQL server daemon can be started only by a user possessing the file system privileges necessary to execute the mysql d_saf e script, it can be stopped by a user possessing the proper privileges as specified within

70、 the MySQL privilege database. Keep in mind that this privilege is typically left solely to the MySQL r oot user, not to be confused with the operating system r oot user!Don’t worry too much about this right now; just un

71、derstand that MySQL users are not the same as operat</p><p>  shel l >cd I NSTALL- DI R/ bi n</p><p>  shel l >mysql admi n - u r oot - p shut down</p><p>  Ent er passwor d:

72、*******</p><p>  Assuming that you supply the proper credentials, you will be returned to the command prompt without notification of the successful shutdown of the MySQL server. In the case of an unsuccessfu

73、l shutdown attempt, an appropriate error message is offered.</p><p>  Configuring and Optimizing MySQL</p><p>  Unless otherwise specified, MySQL assumes a default set of configuration settings

74、upon each start of the MySQL server daemon. Although the default settings are probably suitable for users who require nothing more than a standard deployment, you’ll at least want to be aware of what can be tweaked, beca

75、use such changes not only will better adapt your deployment to your specific hosting environment, but could also greatly enhance the performance of your application based on its behavioral character</p><p> 

76、 For example, some applications might be update intensive, prompting you to adjust the resources that MySQL requires for handling write/ modification queries. Other applications might need to handle a large number of use

77、r connections, prompting a change to the number of threads allocated to new connections. Happily, MySQL is highly configurable; as you’ll learn in this and later chapters, administrators have the opportunity to manage ju

78、st about every aspect of its operation.</p><p>  This section offers an introduction to many of the configuration parameters that affect the general operation of the MySQL server. Because configuration and o

79、ptimization are such important aspects of maintaining a healthy server (not to mention a sane administrator), this topic is returned to often throughout the remainder of the book.</p><p>  The mysqld_safe Wr

80、apper</p><p>  Although the aforementioned mysql d is indeed MySQL’s service daemon, you actually rarely directly interact with it; rather, you can interface with the daemon through a wrapper called mysql d_

81、saf e. The mysql d_saf e wrapper adds a few extra safety-related logging features and system-integrity features to the picture when the daemon is started. Given these useful features, mysql d_saf e is the preferred way t

82、o start the server, although you should keep in mind that it’s only a wrapper and should</p><p>  Managing Connection Loads</p><p>  Awell-tuned MySQL server is capable of working with many conn

83、ections simultaneously. Each connection must be received and delegated to a new thread by the main MySQL thread, a task that, although trivial, isn’t instantaneous. The back_log parameter determines the number of connect

84、ions that are allowed to queue up while this main thread deals with a particularly heavy new connection load. By default, this is set to 80.</p><p>  Keep in mind that you can’t just set this to a very high

85、value and assume it will make MySQL run more efficiently. Both your operating system and web server may have other maximum settings in place that could render a particularly high value irrelevant.</p><p>  S

86、etting the Data Directory Location</p><p>  It’s common practice to place the MySQL data directory in a nonstandard location, such as on another disk partition. Using the dat adi r option, you can redefine t

87、his path. It’s commonplace to mount a second drive to a directory, / dat a for instance, and store the databases in a directory called mysql :</p><p>  %>. / bi n/ mysql d_saf e - - dat adi r =/ dat a/ my

88、sql - - user =mysql &</p><p>  Keep in mind that you need to copy or move the MySQL permission tables (stored in DATADI R/ mysql ) to this new location. Because MySQL’s databases are stored in files, you

89、 can do so by using operating system commands that are typical for performing such actions, such as mv and cp. If you’re using a GUI, you can drag and drop these files to the new location.</p><p>  Configuri

90、ng PHPto Work with MySQL</p><p>  The PHP and MySQL communities have long enjoyed a close relationship. The respective technologies are like two peas in a pod, bread and butter, wine and cheese … you get the

91、 picture. The popularity of MySQL within the PHP community was apparent from the earliest days, prompting the PHP developers to bundle the MySQL client libraries with the distribution and enable the extension by default

92、in PHP version 4.</p><p>  But you can’t just install PHP and MySQL and necessarily expect them to automatically work together. You need to carry out just a few more steps, described next.</p><p&g

93、t;  Reconfiguring PHPon Linux</p><p>  On Linux systems, after you successfully install MySQL, you need to reconfigure PHP, this time including the - - wi t h- mysql i [ =DI R] configuration option, specifyi

94、ng the path to the MySQL installation directory. Once the build is complete, restart Apache and you’re done.</p><p>  Reconfiguring PHPon Windows</p><p>  On Windows, you need to do two things t

95、o enable PHP’s support for MySQL. After successfully installing MySQL, open the php. i ni file and uncomment the following line:</p><p>  ext ensi on=php_mysql i . dl l</p><p>  Restart Apache o

96、r IIS and you’re ready to begin using PHP and MySQL together!</p><p><b>  Summary</b></p><p>  This chapter set the stage for starting experimentation with the MySQL server. You lear

97、ned not only how to install and configure MySQL, but also a bit regarding how to optimize the installation to best fit your administrative and application preferences. Configuration and optimization issues are revisited

98、throughout the remainder of this book as necessary. The next chapter introduces MySQL’s many clients, which offer a convenient means for interacting with many facets of the server.</p><p><b>  譯文:</

99、b></p><p>  安裝和配置MySQL</p><p>  Frank M. Kromann</p><p>  本章將指導(dǎo)您完成MySQL的安裝和配置過程。它并非旨在取代MySQL的優(yōu)秀(和龐大的)用戶手冊,而是強(qiáng)調(diào)了任何想要快速有效地準(zhǔn)備數(shù)據(jù)庫服務(wù)器以供使用的人立即感興趣的關(guān)鍵步驟。涵蓋以下主題:</p><p><b

100、>  ?下載說明</b></p><p><b>  ?分布變化</b></p><p>  ?安裝程序(源,二進(jìn)制,RPM)</p><p>  ?設(shè)置MySQL管理員密碼</p><p>  ?啟動和停止MySQL</p><p>  ?將MySQL安裝為系統(tǒng)服務(wù)</p

101、><p>  ?MySQL配置和優(yōu)化問題</p><p>  ?重新配置PHP以使用MySQL</p><p>  通過本章的結(jié)論,您將學(xué)習(xí)如何安裝和配置可操作的MySQL服務(wù)器。</p><p><b>  正在下載MySQL</b></p><p>  有兩個版本的MySQL數(shù)據(jù)庫:MySQL社區(qū)

102、服務(wù)器和MySQL企業(yè)服務(wù)器。如果您不需要MySQL的支持,監(jiān)視和優(yōu)先級更新服務(wù),則應(yīng)使用前者。如果上述任何或所有服務(wù)可能對您有吸引力,請在ht t ps:/ / www了解有關(guān)MySQL Enterprise的更多信息。 mysql。 com / product s / ent er pr i se。本書假定您正在使用社區(qū)服務(wù)器版,可以通過MySQL網(wǎng)站免費下載。要下載最新的MySQL版本,請導(dǎo)航到ht t ps:/ / www。 m

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 眾賞文庫僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

最新文檔

評論

0/150

提交評論