HomeMySQL Page 3 - MySQL Installation and Configuration
Installing and Configuring MySQL (Linux/Unix) - MySQL
In this chapter, Vikram discusses how to obtain, install, configure, and test the MySQL server on Unix and Windows. It also explains the differences between the different MySQL sever versions available, with a view to helping you select the right one for your needs. This excerpt comes from chapter three of MySQL: The Complete Reference, by Vikram Vaswani (McGraw-Hill/Osborne, ISBN 0-07-222477-0, 2004).
Once you’ve got yourself a copy of MySQL, it’s time to install and configure it for your specific platform. This section includes information on how to do just that, for both Windows and UNIX platforms, using both binary and source distributions.
It should be noted at the outset that this section is designed merely to provide an overview and general guide to the process of installing and configuring MySQL. It is not intended as a replacement for the installation documentation that ships with MySQL. If you encounter difficulties installing or configuring the various programs described here, drop by the MySQL web site or search the mailing lists for detailed troubleshooting information and advice.
Installing and Configuring MySQL on UNIX
MySQL is available in binary form for almost all versions of UNIX and can even be compiled for those UNIX variants for which no binary distribution exists. This section will discuss installing and configuring MySQL on Linux using both source and binary distributions; the process for other UNIX variants is similar, although you should refer to the documentation included with the MySQL distribution for platform-specific notes.
Installing MySQL from a Binary RPM Distribution
The recommended way to install MySQL on a Linux system is via RPM. MySQL AB makes the following RPMs available for download on its web site:
MySQL The MySQL database server, which manages databases and tables, controls user access, and processes SQL queries
MySQL-client MySQL client programs, which makes it possible to connect to, and interact with, the server
MySQL-devel Libraries and header files that come in handy when compiling other programs that use MySQL
MySQL-shared Shared libraries for the MySQL client
MySQL-bench Benchmark and performance testing tools for the MySQL database server
MySQL software distributions are usually packaged in Zip, tar (tape archive), or RPM (RPM Package Manager) format, and they can range from 7 to 20 MB in size in compressed form, and up to 100 MB in size in uncompressed form. Depending on the format you select, you will need appropriate unpackaging tools to extract the files from the source archive. For Zip and tar files, you will need GNU tar and GNU gunzip, available from http://www.gnu.org.
Figure 2 displays what you should see while performing this task.
FIGURE 2Installation of ancillary MySQL tools and utilities via RPM
Note that it’s necessary to install only the server; however, I would recommend thatyou install the client as well so that you can interact with the server from the system console. The benchmark utilities should be installed only if you plan to test MySQL performance, while the libraries and header files come in handy when you’re compiling other utilities or tools that use MySQL (for example, the PHP scripting language).
Once installation has been successfully completed, you should move later in the chapter to the section titled “Testing MySQL” to verify that everything is working as it should.
Remember: this is chapter three of MySQL: The Complete Reference, by Vikram Vaswani (McGraw-Hill/Osborne, ISBN 0-07-222477-0, 2004). Vikram is the founder of Melonfire, and has had numerous articles featured on Dev Shed. Buy this book now.