Online Book Reader

Home Category

MySQL in a Nutshell [9]

By Root 22135 0
the installation will be canceled. If you want to upgrade an existing installation, you can replace the i option in the example with an uppercase U.

When the RPM files are installed, the mysqld daemon will be started or restarted automatically. Once MySQL is installed and running, you need to make some postinstallation adjustments that are explained in the last section of this chapter (Postinstallation”).

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 your server is not running a graphical user interface (GUI) or a desktop manager, you can instead install MySQL on a Macintosh system with a TAR package. This can be downloaded from the download page on MySQL’s web site. Explanation of that method of installation is included here.

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 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, from the Finder desktop manager, double-click on the disk image file (the .dmg file) that you downloaded. This will reveal the disk image file’s contents. Look for the PKG files; there will be at least two. Double-click on the one named MySQL followed by the version numbers. This will 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. You will need an administrator username and password. 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.

To install the TAR package instead of the PKG package, download the TAR file from MySQL’s site and move it to the /usr/local directory, and then change to that directory. Next, untar and unzip the installation program like so:

cd /usr/local

tar xvfz mysql-version.tar.gz

In this example, change version to the actual version number. From here create a symbolic link for the installation directory. Then run the configuration program:

ln -s /usr/local/mysql-version /usr/local/mysql

cd /usr/local/mysql

./configure --prefix=/usr/local/mysql \

--with-unix-socket-path=/usr/local/mysql/mysql_socket \

--with-mysqld-user=mysql

Depending on your needs, you might provide other options than just these few. Next, you should set the ownership and group for the files and directories created to the mysql user and group, which should have been created by the installation program. For some systems, you may have to enable permissions for the hard drive or volume first. To do that, use the vsdbutil utility. If you want to check if permissions are enabled on the volume first, use the -c option; to just enable it, use the -a option for vsdbutil. You should also make a link to the mysql client and to mysqladmin from the /usr/bin directory:

vsdbutil -a /Volumes/Macintosh\ HD/

sudo chgrp -R mysql /usr/local/mysql/.

sudo chown -R mysql /usr/local/mysql/.

ln -s /usr/local/mysql/bin/mysql /usr/bin/mysql

ln -s /usr/local/mysql/bin/mysqladmin

Return Main Page Previous Page Next Page

®Online Book Reader