2.5. Macintosh OS X Distributions


On recent versions of Mac OS X, MySQL is usually installed already. However, in case it is not installed on your system or you want to upgrade your copy of MySQL by installing the latest release, directions are included here.

As of Version 10.2 of Mac OS X and Version 4.0.11 of MySQL, binary package (PKG) files are available for installing MySQL. If your server is using an older version of Mac OS X, you need to install MySQL using a Unix source or binary distribution, following the directions described earlier in this chapter for those particular packages.

If an older version of MySQL is already installed on your server, you will need to shut down the MySQL service before installing and running the newer version. You can do this with the MySQL Manager Application, which is a graphical user interface (GUI) application. It's typically installed on recent versions of Mac OS X by default. If your server doesn't have the MySQL Manager Application, enter the following from the command line to shut down the MySQL service:

mysqladmin -u root shutdown

Incidentally, if MySQL isn't already installed on your system, you may need to create the system user, mysql, before installing MySQL.

To install the MySQL package file, use the Finder utility to locate the disk image file (the .dmg file) that you downloaded, and mount it by double-clicking it. This reveals the disk image file's contents. Look for the PKG icon, and double-click it to begin the installation program. The installer will take you through the installation steps from there. The default settings are recommended for most users and developers.

Once you've finished installing MySQL, start the service by entering the following from the command line:

sudo /usr/local/mysql/bin/mysqld_safe [Ctrl-z] bg

On the second line, hold down the Ctrl key and then press the Z key. Finally enter bg to send the daemon's process to the background.

To have MySQL started at boot time, add a StartupItem. Within the disk image file that you downloaded, you should see an icon labeled MySQLStartupItem.pkg. Just double-click it, and it will create a StartupItem for MySQL. Once it's created, instead of using the method shown previously to start the service, enter the following from the command line:

sudo /Library/StartupItems/MySQL/MySQL start

Once MySQL is installed and running, you need to make some postinstallation adjustments that are explained in the last section of this chapter.



MySQL in a Nutshell
MYSQL in a Nutshell (In a Nutshell (OReilly))
ISBN: 0596514336
EAN: 2147483647
Year: 2006
Pages: 134
Authors: Russell Dyer

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net