11.07.2015 Views

PHP MySQL - Stilson.net

PHP MySQL - Stilson.net

PHP MySQL - Stilson.net

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CHAPTER 26 • INSTALLING AND CONFIGURING MYSQLwww.it-ebooks.infofocuses on the Linux installation process, keep in mind that the procedure is largely identical for allplatforms (many of which are available for download on the <strong>MySQL</strong> web site) except for Windows, whichis covered in the next section.To install the <strong>MySQL</strong> binary on Linux, you need to have tools capable of unzipping and untarringthe binary package. Most Linux distributions come with the GNU gunzip and tar tools, which arecapable of carrying out these tasks.You can download the <strong>MySQL</strong> binary for your platform by navigating to the <strong>MySQL</strong> web site’sDownloads section. Unlike the RPMs, the binaries come with both the server and client packagedtogether, so you need to download only a single package. Download this package, saving it to yourpreferred distribution repository directory. It’s common to store packages in the /usr/src directory, butthe location has no bearing on the final outcome of the installation process.Although the binary installation process is a tad more involved than installing an RPM in terms ofkeystrokes, it is only slightly more complicated in terms of required Linux knowledge. This process canbe divided into four steps:1. Create the necessary group and owner (you need to have root privileges forthis and the following steps):%>groupadd mysql%>useradd –g mysql mysql2. Decompress the software to the intended directory. Using the GNU gunzip andtar programs is recommended.%>cd /usr/local%>tar -xzvf /usr/src/mysql-VERSION-OS.tar.gz3. Link the installation directory to a common denominator:%>ln -s FULL-PATH-TO-MYSQL-VERSION-OS mysql4. Install the <strong>MySQL</strong> database. mysql_install_db is a shell script that logs in tothe <strong>MySQL</strong> database server, creates all of the necessary tables, and populatesthem with initial values.%>cd mysql%>chown -R mysql .%>chgrp -R mysql .%>scripts/mysql_install_db --user=mysql%>chown -R root .%>chown -R mysql dataThat’s it! Proceed to the “Setting the <strong>MySQL</strong> Administrator Password” section.The Source Installation ProcessThe <strong>MySQL</strong> developers have gone to great lengths to produce optimized RPMs and binaries for a widearray of operating systems, and you should use them whenever possible. However, if you are workingwith a platform for which no binary exists, require a particularly exotic configuration, or happen to be arather controlling individual, then you also have the option to install from source. The process takes onlyslightly longer than the binary installation procedure.490

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!