Downloaded the latest MySQL installer from dev.mysql.com. I chose the Mac OS X Installer Package for 10.3.

I double-clicked the file that I downloaded (mysql-standard-4.1.11-apple-darwin7.8.0-powerpc.dmg), then double-clicked the mysql-standard-4.1.11-apple-darwin7.8.0-powerpc.pkg icon to run the installer and install MySQL.

Next, I installed the MySQLStartupItem.pkg because I want MySQL to start up when I start my Mac.

Then, I copied the MySQL.prefPane into the PreferencePanes folder in my Library folder at the root level of my hard drive. Tiger asked me to authenticate when I did this. Upon opening my System Preferences, I can indeed see a pretty MySQL icon.

I wanted to test to see if MySQL would really start up, so I restarted. Sure enough, MySQL was running.

Next, it was time to set initial passwords for MySQL. To do that, I opened the Terminal (in the Utilities folder). Then I typed in the following:

export PATH="$PATH:/usr/local/mysql/bin"

This tells your computer that when it interprets commands, it should also look in the freshly created MySQL installation for MySQL commands. If you want it added permanently instead of just for this terminal session, you could edit the third line of /etc/profile to read

PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/mysql/bin"

and then start a new Terminal window.

Downloaded the latest MySQL installer from dev.mysql.com. I chose the Mac OS X Installer Package for 10.3.

I double-clicked the file that I downloaded (mysql-standard-4.1.11-apple-darwin7.8.0-powerpc.dmg), then double-clicked the mysql-standard-4.1.11-apple-darwin7.8.0-powerpc.pkg icon to run the installer and install MySQL.

Next, I installed the MySQLStartupItem.pkg because I want MySQL to start up when I start my Mac.

Then, I copied the MySQL.prefPane into the PreferencePanes folder in my Library folder at the root level of my hard drive. Tiger asked me to authenticate when I did this. Upon opening my System Preferences, I can indeed see a pretty MySQL icon.

I wanted to test to see if MySQL would really start up, so I restarted. Sure enough, MySQL was running.

Next, it was time to set initial passwords for MySQL. To do that, I opened the Terminal (in the Utilities folder). Then I typed in the following:

export PATH="$PATH:/usr/local/mysql/bin"

This tells your computer that when it interprets commands, it should also look in the freshly created MySQL installation for MySQL commands. If you want it added permanently instead of just for this terminal session, you could edit the third line of /etc/profile to read

PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/mysql/bin"

and then start a new Terminal window.

Next, we want to make MySQL secure by setting a MySQL root password. Fortunately a handy utility is provided to make that easy. I typed in:

mysql_secure_installation

Interacting with the script looked like this (note that at the first prompt I just pressed enter since no root password has been set yet:

Enter current password for root (enter for none): 
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.

Set root password? [Y/n] Y
New password: zoinks
Re-enter new password: zoinks
Password updated successfully!
Reloading privilege tables..
 ... Success!


By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] Y
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] Y
 ... Success!

By default, MySQL comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] Y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] Y
 ... Success!

Cleaning up...



All done!  If you've completed all of the above steps, your MySQL
installation should now be secure.

Thanks for using MySQL!

I verified that MySQL was running:

$ mysqladmin -u root -p status
Enter password: zoinks
Uptime: 938  Threads: 1  Questions: 16  Slow queries: 0  Opens: 21  
Flush tables: 1  Open tables: 0  Queries per second avg: 0.017

It was running fine. Now on to the task of setting up MySQL for Drupal.

Comments

phrenq’s picture

I tried following this verbatim but mysql didn't start until I ran:

sudo ./scripts/mysql_install_db

from the /usr/local/mysql directory. After that, things seem fine.

btolnas’s picture

I followed the Instructions above religiously but kept getting an error suggesting I had the wrong username and password in settings.php and the MySQL error was somehting like 'MySQL Error: Could not connect to MySQL on socket /var/mysql/mysql.sock. I was using MySQL-5.0.21 and the php 4.4.1 that was already on my Tiger machine. I figured out that changing the hostname in the $db_url variable in settings.php to 127.0.0.1 instead of localhost worked. Finally I found a better solution here: http://docs.info.apple.com/article.html?artnum=301457. The problem is that when connecting as localhost, php uses a unix domain socket instead of a TCP/IP, but PHP is looking for the socket file created by MySQL in the wrong place. PHP assumes /var/mysql/mysql.sock, but MySQL-5.0.21 was using /tmp/mysql.sock. So following instruction in the above URL (only their example changes the socket file to exactly the opposite of what I needed) I created the php.ini file and edited the the default socket to this:

mysql.default_socket = /tmp/mysql.sock

Then restart apache to make the change take effect:

sudo apachectl restart

Hope that saves somebody some time.

Barry

darumaki’s picture

the apple link shows for php.ini mysql.default_socket = /var/mysql/mysql.sock but above you put /tm/mysql.sock, was that the correct method ?

mfricke’s picture

As Barry has pointed out (with solution), the otherwise excellent Notes for setting up Drupal on Tiger won't work with modern versions of OS X 10.4 because of the new way that php interacts with mySQL.

Check

http://www.macintouch.com/readerreports/macosx10_4_4/topic2055.html

http://docs.info.apple.com/article.html?artnum=301457

and, perhaps,

http://m.iscellaneo.us/2006/01/21/how-to-fix-mysql-problems-in-osx-due-t...

Best,

Martin