Databases Reference
In-Depth Information
Figure 2-20. The MySQL preferences pane
You should now change the files in the MySQL directory to be owned by
root
but be
in the
mysql
group:
$
sudo chown -RL root:mysql /usr/local/mysql
The
-RL
option tells the
chown
command to apply the ownership rule recursively (
R
) to
everything under the
/usr/local/mysql
directory, following symbolic links (
L
) if nec-
essary. You should also change the database files in the data directory to be owned by
the
mysql
user and group:
$
sudo chown -RL mysql:mysql /usr/local/mysql/data
If you used the
mysql_install_db
script with the
user=mysql
option, this will already
have been done for you.
You can now start the server and stop it in several ways; let's look at a few of these.
First, if you installed the MySQL.prefPane item, you can use the MySQL pane in the
System Preferences window. To access this, click on the Apple logo at the top left of
the screen menu, select the “System Preferences...” menu entry, and then click on the
MySQL icon in the System Preferences window. This will bring up a window similar
to Figure 2-20, with a button labeled Start MySQL Server when the server is not running
and Stop MySQL Server when it is. Clicking on this button will start or stop the server.
You may be asked to type in your password.
Second, you can use the
mysql.server
script in the MySQL directory:
$
sudo /usr/local/mysql/support-files/mysql.server start