Spec-Zone .ru
спецификации, руководства, описания, API

2.4.3. Installing the MySQL Startup Item

The MySQL Installation Package includes a startup item that can be used to automatically start and stop MySQL.

To install the MySQL Startup Item:

  1. Download and open the MySQL package installer, which is provided on a disk image (.dmg) that includes the main MySQL installation package, the MySQLStartupItem.pkg installation package, and the MySQL.prefPane. Double-click the disk image to open it.

  2. Double-click the MySQLStartItem.pkg file to start the installation process.

  3. You will be presented with the Install MySQL Startup Item dialog.

    MySQL Startup Item Installer: Step 1

    Click Continue to continue the installation process.

  4. A copy of the installation instructions and other important information relevant to this installation are displayed. Click Continue .

  5. 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.

    MySQL Startup Item Installer: Step 3
  6. You will be asked to confirm the details of the installation. To change the drive on which the startup item is installed, click either Go Back or Change Install Location.... To install the startup item, click Install.

  7. Once the installation has been completed successfully, you will be shown an Install Succeeded message.

    MySQL Startup Item Installer: Step 5

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, change this variable to MYSQLCOM=-NO-.

After the installation, you can start and stop MySQL by running the following commands in a terminal window. You must have administrator privileges to perform these tasks, and you may be prompted for your password.

If you have installed the Startup Item, use this command to start the server:

shell> sudo /Library/StartupItems/MySQLCOM/MySQLCOM
        start

If you have installed the Startup Item, use this command to stop the server:

shell> sudo /Library/StartupItems/MySQLCOM/MySQLCOM
        stop