MySQL

MySQL is a free relational database, now owned by Oracle.
Installing MySQL
Here are instructions for setting up a 64-bit MySQL on Snow Leopard, tested August 2010 with 10.6.4.
These instructions will also work on Lion (10.7).
Oracle does not provide a version of MySQL for Lion on its download page as of 10 Feb 2012,
but I downloaded version 5.5.20 for 10.6 and installed it on Lion, reloaded the database, and things appear to work.
(I did have to re-install CPAN for Lion.)
- If you have a previous version of MySQL, dump its database to a .sql text file using mysqldump before installing.
- Rename ~/.my.cnf to something else if you have one.
-
Download x86-64 bit MySQL Community Server 5.1 or 5.5 dmg file from http://www.mysql.com/ and install it.
I found a page that describes one user's process: http://weblog.rubyonrails.org/2009/8/30/upgrading-to-snow-leopard.
I skipped the Ruby parts.
- Wait to reload the database and set root password until after CPAN is updated and DBD::mysql is installed.
- Change your startup variables to export VERSIONER_PERL_PREFER_32_BIT=no or you will get a failure message about dyld when using DBD.
- To set root password, do mysqladmin -u root password WHATEVER .
- Rename ~/.my.cnf back.
- To reload database, do mysql < db.sql .
Your old mysql dtabase is still on disk, and can be deleted at some point.
.my.cnf
If you make a file named .my.cnf in your home directory, then you can use the mysql command without giving a password. Mine contains
[client]
user=root
password=WHATEVER
host=localhost
If you have only one database, you can put that value in the file also, with database=DBNAME.
Home | FAQ
© 2010-2012, Tom Van Vleck
updated 2012-04-04 19:04