SunQuest
 
       MySQL
  Home arrow MySQL arrow Page 3 - MySQL Installation and Configuration
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Actuate Whitepapers 
VeriSign Whitepapers 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
IBM developerWorks
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
MYSQL

MySQL Installation and Configuration
By: McGraw-Hill/Osborne
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 110
    2004-04-28

    Table of Contents:
  • MySQL Installation and Configuration
  • Choosing Between Binary and Source Distributions
  • Installing and Configuring MySQL (Linux/Unix)
  • Installing MySQL from a Binary Tarball Distribution (Linux/Unix)
  • Installing MySQL from a Source Distribution (Linux/Unix)
  • Installing and Configuring MySQL on Windows
  • Installing MySQL from a Source Distribution (Windows)
  • Testing MySQL
  • Post-Installation Steps

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    MySQL Installation and Configuration - Installing and Configuring MySQL (Linux/Unix)


    (Page 3 of 9 )

    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

    Needful Things

    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.

    For RPM files, you will need rpm, available from http://www.rpm.org. Additionally, if you’re planning on compiling and installing MySQL from a source distribution, you will need a C++ compiler like gcc on UNIX or Visual C++ on Windows. The gcc compiler is available from http://www.gnu.org/software/gcc, while Visual C++ is available from http://msdn.microsoft.com/visualc.

    The MySQL RPMs listed here are all built on a SuSE Linux system, but they’ll usually work on other Linux variants with no difficulty.

    Installing an RPM distribution of MySQL is extremely simple, and it involves running only a single command--the rpm command--for each RPM you wish to install. Here’s how you go about doing it:

    1. First ensure that you’re logged in as root:

    [user@host]# su – root

    2. Switch to the directory containing the RPMs:

    [root@host]# cd /tmp

    3. Install the MySQL database server by executing the following command (remember to replace the filename in italics with the file name of your RPM):

    [root@host]# rpm -i MySQL-4.0.9-0.i386.rpm

    RPM does the following things to get MySQL up and running on your system:

    • Copies the MySQL binaries to appropriate locations on your system (usually, binaries go to /usr/bin and /usr/sbin, while databases and tables are stored in /var/lib/mysql)

    • Adds a mysql user/group to the system to handle all MySQL-related operational and administrative tasks

    • Alters ownership of the MySQL binaries so that they are owned by the mysql user/group

    • Creates and initializes the MySQL grant tables

    • Adds appropriate entries to your system’s startup scripts so that the MySQL server starts up automatically at boot time

    • Starts the server so that you can begin using it immediately

    Figure 1 shows a snippet of what you might see during the installation process:

    MySQL Installation and Configuration
    FIGURE 1 Installation of the MySQL server via RPM

    4. Now install the remaining RPMs in a similar manner:

    [root@host]# rpm -i MySQL-client-4.0.9-0.i386.rpm
    [root@host]# rpm -i MySQL-devel-4.0.9-0.i386.rpm
    [root@host]# rpm -i MySQL-shared-4.0.9-0.i386.rpm
    [root@host]# rpm -i MySQL-bench-4.0.9-0.i386.rpm

    Figure 2 displays what you should see while performing this task.

    MySQL Installation and Configuration
    FIGURE 2 Installation 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.

    More MySQL Articles
    More By McGraw-Hill/Osborne


     

       

    MYSQL ARTICLES

    - MySQL Table Prefix Changer Tool in PHP
    - Using the SIGNAL Statement for Error Handling
    - Error Handling Examples
    - Error Handling
    - Completing a Search Engine with MySQL and PH...
    - Paginating Result Sets for a Search Engine B...
    - Building a Search Engine with MySQL and PHP 5
    - Using Boolean Operators for Full Text and Bo...
    - PHP, MySQL and the PEAR Database
    - Working with PHP and MySQL
    - Getting PHP to Talk to MySQL
    - Creating an RSS Reader: the Reader
    - MySQL Security Overview
    - Creating the Admin Script for a PHP/MySQL Bl...
    - Creating the Blog Script for a PHP/MySQL Blo...





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway