Installing MySQL On Mac OS X (Darwin Kernel)

Recently I happen to install MySQL on Mac OS X (Darvin Kernel).  Below are the quick 5 steps to accomplish the task.

Step 1: Check Mac Version
Very first step is to verify the Mac OS X’s current version to decide MySQL Installation file to be downloaded.
For example for Mac version: 10.4 you should download “Mac OS X 10.4 (x86, 32-bit), Compressed TAR Archive (mysql-5.1.51-osx10.4-i686.tar.gz)”

How to Check Mac Version:
cat /System/Library/CoreServices/SystemVersion.plist

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"

"http://www.apple.com/DTDs/PropertyList-1.0.dtd">

</p> <plist version="1.0"> <dict>

<key>ProductBuildVersion</key>  <string>8S2169</string>

<key>ProductCopyright</key><string>1983-2007 Apple Inc.</string>

<key>ProductName</key> <string>Mac OS X</string>

<key>ProductUserVisibleVersion</key> <string>10.4.11</string>

<key>ProductVersion</key> <string>10.4.11</string> </dict>

Installation Error:

dyld: unknown required load command 0x80000022

I ran in to problems while I installed MySQL for Mac OS X 10.5. Ofcourse I missed the step one and paid for it.
It’s about MySQL binary’s version difference errors: “dyld: unknown required load command 0x80000022”.

Step 2: Download MySQL Installation (tar.gz) file from dev.mysql’s download section.
For example go to: http://dev.mysql.com/downloads/mysql/5.1.html

Select appropriate OS & version and get the exact download link from mirror:

cd /usr/local/
wget http://dev.mysql.com/get/Downloads/
MySQL-5.1/mysql-5.1.51-osx10.4-i686.tar.gz/from/http://mysql.mirror.rafal.ca/

Step 3: Create MySQL User and Group.

Through command line we can use NetInfo Utility as:
niutil -create / /groups/mysql
niutil -createprop / /groups/mysql gid 401
niutil -create / /users/mysql
niutil -createprop / /users/mysql gid 401
niutil -createprop / /users/mysql uid 401

Assign password to “mysql” user
passwd mysql

Step: 4 Installing MySQL using Generic Binaries
cd /usr/local
tar -xzvf mysql-VERSION-OS.tar.gz
ln -s full-path-to-mysql-VERSION-OS mysql
cd mysql
chown -R mysql .
chgrp -R mysql .
scripts/mysql_install_db --user=mysql
chown -R root .
chown -R mysql data
cp /usr/local/mysql/support-files/my-small.cnf /etc/my.cnf

Step: 5 Start MySQL Server:

bin/mysqld_safe –user=mysql &

This finishes basic installation of MySQL on Mac OS X. Make sure you follow “best practices” or “after installation steps” as recommended.

Recently I happen to install MySQL on Mac OS X (Darvin Kernel). Below are the quick 5 steps to accomplish the task.

<strong>Step 1:  Check Mac Version</strong>
Very first step is to verify the Mac OS X’s current version to decide MySQL Installation file to be downloaded.
For example for Mac version: 10.4 you should download “Mac OS X 10.4 (x86, 32-bit), Compressed TAR Archive (mysql-5.1.51-osx10.4-i686.tar.gz)”

How to Check Mac Version:
<code>cat /System/Library/CoreServices/SystemVersion.plist
<xmp>
<?xml version=”1.0″ encoding=”UTF-8″?>
<!DOCTYPE plist PUBLIC “-//Apple Computer//DTD PLIST 1.0//EN” “http://www.apple.com/DTDs/PropertyList-1.0.dtd”>
<plist version=”1.0″>
<dict>
<key>ProductBuildVersion</key>
<string>8S2169</string>
<key>ProductCopyright</key>
<string>1983-2007 Apple Inc.</string>
<key>ProductName</key>
<string>Mac OS X</string>
<key>ProductUserVisibleVersion</key>
<string>10.4.11</string>
<key>ProductVersion</key>
<string>10.4.11</string>
</dict></code>
</xmp>

Installation Error: <h2>dyld: unknown required load command 0x80000022<h2>
I ran in to problems while I installed MySQL for Mac OS X 10.5. Ofcourse I missed the step one and paid for it.
It’s about MySQL binary’s version difference errors: “dyld: unknown required load command 0x80000022”.

<strong>Step 2: Download MySQL Installation (tar.gz) file from dev.mysql’s download section.</strong>
For example go to: http://dev.mysql.com/downloads/mysql/5.1.html

Select appropriate OS & version and get the exact download link from mirror:
<code>
cd /usr/local/
wget http://dev.mysql.com/get/Downloads/MySQL-5.1/mysql-5.1.51-osx10.4-i686.tar.gz/from/http://mysql.mirror.rafal.ca/</code>

<strong>Step 3: Create MySQL User and Group.</strong>

Through command line we can use NetInfo Utility as:
<code>niutil -create / /groups/mysql
niutil -createprop / /groups/mysql gid 401
niutil -create / /users/mysql
niutil -createprop / /users/mysql gid 401
niutil -createprop / /users/mysql uid 401</code>

Assign password to “mysql” user
passwd mysql

<strong>Step: 4   Installing MySQL using Generic Binaries</strong>
<code>cd /usr/local
tar -xzvf mysql-VERSION-OS.tar.gz
ln -s full-path-to-mysql-VERSION-OS mysql
cd mysql
chown -R mysql .
chgrp -R mysql .
scripts/mysql_install_db –user=mysql
chown -R root .
chown -R mysql data
cp /usr/local/mysql/support-files/my-small.cnf /etc/my.cnf</code>

<strong>Step: 5     Start MySQL Server:</strong>

bin/mysqld_safe –user=mysql &

This finishes basic installation of MySQL on Mac OS X. Make sure you follow “best practices” or “after installation steps” as recommended.

2 comments
  1. Hey! This is kind of off topic but I need some help from an established
    blog. Is it difficult to set up your own blog?
    I’m not very techincal but I can figure things out pretty quick. I’m
    thinking about creating my own but I’m not sure where to begin. Do you have any ideas or suggestions? With thanks

Leave a Reply

Your email address will not be published. Required fields are marked *