Package Installation on Mac OS
sudo su -
Apache
Start
sudo apachectl start
Test
http://localhostShutdown
sudo apachectl stop
Configuration
/Library/WebServer/
/etc/apache2
MySql
The package is located inside a disk image (
.dmg
) file that you first need to mount by double-clicking its icon in the Finder.You can also install the MySQL Preference Pane, which will enable you to control the startup and execution of your MySQL server from System Preferences
When installing using the package installer, the files are installed into a directory within
/usr/local
matching the name of the installation version and platform.
The following table shows the layout of the installation directory.
Table 2.5 MySQL Installation Layout on OS X
Directory | Contents of Directory |
---|---|
bin , scripts | mysqld server, client and utility programs |
data | Log files, databases |
docs | Helper documents, like the Release Notes and build information |
include | Include (header) files |
lib | Libraries |
man | Unix manual pages |
mysql-test | MySQL test suite |
share | Miscellaneous support files, including error messages, sample configuration files, SQL for database installation |
sql-bench | Benchmarks |
support-files | Scripts and sample configuration files |
/tmp/mysql.sock | Location of the MySQL Unix socket |
During the package installer process, a symbolic link from
/usr/local/mysql
to the version/platform specific directory created during installation will be created automatically.
The MySQL Installation Package includes a startup item that can be used to automatically start and stop MySQL.
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 the MySQL server from the MySQL Preference Pane (preferred), or 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
留言