Learning Mysql


Installing Under Mac OS X | 63



Download 4.24 Mb.
View original pdf
Page62/366
Date04.08.2023
Size4.24 Mb.
#61806
1   ...   58   59   60   61   62   63   64   65   ...   366
Learning MySQL
Installing Under Mac OS X | 63


$ sudo niutil -createprop / /groups/mysql gid 74
$ sudo niutil -createprop / /users/mysql uid 74
Finally, associate the mysql user with the mysql group sudo niutil -createprop / /users/mysql gid 74
When you’re sure the correct user and group exist, you have to initialize the MySQL
databases. First, change to the MySQL base directory cd /usr/local/mysql
Then 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=mysql
Figure 2-19. Verifying that the mysql group exists
64 | 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/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 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/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 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 start
Figure 2-20. The MySQL preferences pane

Download 4.24 Mb.

Share with your friends:
1   ...   58   59   60   61   62   63   64   65   ...   366




The database is protected by copyright ©ininet.org 2024
send message

    Main page