The MySQL Installation Package includes a startup item that can be used to automatically startup and shutdown MySQL during boot.
To install the MySQL Startup Item:
Download and open the MySQL package installer, which is
provided on a disk image (.dmg
).
Double-click to open the disk image, which includes the main
MySQL installation package, the
MySQLStartupItem.pkg
installation
package, and the MySQL.prefPane
.
Double-click on the MySQLStartItem.pkg
file to start the installation process.
You will be presented with the Install MySQL Startup Item dialog.
Click Continue to continue the installation process.
A copy of the installation instructions and other important information relevant to this installation are display. Click Continue .
Select the drive you want to use to install the MySQL Startup Item. The drive must have a valid, bootable, Mac OS X operating system installed. Click Continue.
You will be asked to confirm the details of the installation. To change the drive on which the startup item is installed you can click either Go Back or Change Install Location.... To install the startup item, click Install.
Once the installation has been completed successfully, you will be given an Install Succeeded message.
The Startup Item for MySQL is installed into
/Library/StartupItems/MySQLCOM
. The Startup
Item installation adds a variable
MYSQLCOM=-YES-
to the system configuration file
/etc/hostconfig
. If you want to disable the
automatic startup of MySQL, simply change this variable to
MYSQLCOM=-NO-
.
After the installation, you can start up MySQL by running the following commands in a terminal window. You must have administrator privileges to perform this task.
If you have installed the Startup Item, use this command to start the server:
shell> sudo /Library/StartupItems/MySQLCOM/MySQLCOM start
You may be prompted for your password to complete the startup.
If you have installed the Startup Item, use this command to stop the server:
shell> sudo /Library/StartupItems/MySQLCOM/MySQLCOM stop
You may be prompted for your password to complete the shutdown.