Installing MySQL

This section shows you how to install and configure your MySQL 4 DBMS server. When you've completed this section, continue on to Section A.3.1 and Section A.3.2.

  1. Get a shell prompt (by running a terminal) and log in as the root user. You can log in as root by typing su and then supplying the root user password.

  2. If you determined earlier in Section A.1 that a MySQL server is already running, stop it using:

    %password

    If your MySQL isn't installed in this directory, replace the directory with the correct one you noted earlier. If this doesn't work, try omitting -p password from the command.

  3. Download MySQL. At the time of writing, we recommend MySQL 4.0 for the reasons discussed in Section A.1.

    To download MySQL, visit http://www.mysql.com/downloads/. Under the heading MySQL database server & standard clients, click on the link that's marked as the production release. From the release page, choose the option under "Source Downloads" marked "tarball (.tar.gz)". Download the file into a directory where files can be created and there is sufficient disk space. A good location is /tmp.

    The http://mysql.com web site recommends you use their precompiled versions of MySQL, rather than creating one yourself. You can do this, and it usually works, but occasionally you'll find you don't have all of the support libraries and versions you need for a successful installation. We therefore recommend that the most reliable option, despite the warning, is to build your own version from source ...

Get Web Database Applications with PHP and MySQL, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.