Enabling/Installing MySQL on OS X Server

Apple’s OSX Server 10.3 and above (that includes 10.4 – you know who you are) comes pre-installed with MySQL Server. You don’t (as many sites suggest) have to install it at all. It is exceptionally simple to enable.

Start Terminal.app (thats the little black window) and then enter the following

Create the MySQL Directories
sudo mkdir /var/mysql
Install the MySQL Databases
sudo mysql_install_db
Make the MySQL user and group the owner of their files
sudo chown -R mysql:mysql /var/mysql
Set MySQL to start at boot
sudo sh -c 'echo "MYSQL=-YES-" >> /etc/hostconfig'
Start MySQL Server
sudo /System/Library/StartupItems/MySQL/MySQL start
Set the root user password
/usr/bin/mysqladmin -u root password 'new-password'

Obviously – change new-password above to something a little more secure

Agree, disagree? Tell somebody!

Leave a Reply

Switch to our mobile site