Installing MySQL
- Go to http://www.mysql.com/downloads/mysql/
- Download “Mac OS X ver. 10.6 (x86, 64-bit), DMG Archive“
- Open the downloaded .dmg file.
- Open “mysql-5.5.19-osx10.6-x86_64.pkg” (or a similarly named file) and follow the instructions to install MySQL.
- Open “MySQL.prefPane” to add an MySQL entry to System Preferences.
To start the MySQL server, open System Preferences and go to MySQL. There you can start and stop the MySQL server. You can also choose to automatically start the MySQL server on startup.
PHP and Database Connection Problems
If you use Mac OS X’s build-in Apache web server, enabled the PHP module and get database connection problems, you need to edit /private/etc/php.ini. If this file does not exist yet, create it by copying /private/etc/php.ini.default.
Open php.ini and change the line
pdo_mysql.default_socket=/var/mysql/mysql.sock
to
pdo_mysql.default_socket=/tmp/mysql.sock
and
mysql.default_socket = /var/mysql/mysql.sock
to
mysql.default_socket = /tmp/mysql.sock
After saving php.ini, restart Apache with sudo apachectl restart
Recent Comments