$
sudo niutil -createprop / /groups/mysql gid 74$
sudo niutil -createprop / /users/mysql uid 74Finally, associate the mysql
user with the mysql group sudo niutil -createprop / /users/mysql gid 74When you’re sure the correct user and group exist, you
have to initialize the MySQLdatabases. First, change to the MySQL base directory
cd /usr/local/mysqlThen run the mysql_install_db script from the scripts directory. The user option assigns ownership of the MySQL datafiles and folders to the specified user—here
to the system mysql account sudo scripts/mysql_install_db --user=mysqlFigure 2-19. Verifying that the mysql group exists64 | Chapter 2:Installing MySQL 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/mysqlThe
-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 necessary. 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/dataIf 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 theSystem 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 theMySQL 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 maybe 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 startFigure 2-20. The MySQL preferences paneShare with your friends: