« Backup day | Main | 9 »

How to find MySQL in Snow Leopard

| No Comments

Just discovered that in Mac OS X 10.6 Snow Leopard, the directory /usr/local/mysql no longer exists.

Which means that if you previously ran commands like mysqldump from /usr/local/mysql/bin, those commands won't work any more. For example, if you have a backup script that uses mysqldump to back up a database, that script breaks under Snow Leopard.

Fortunately, there's an easy-to-implement fix: create /usr/local/mysql as a symlink/alias pointing to the actual MySQL directory in /usr/local.

Planet Geek shows how to create a mysql symlink. You'll have to have root access on your machine, of course, and you'll have to plug in your actual mysql directory name at the appropriate place; for example, mine is mysql-standard-5.0.22-osx10.4-i686.

Note that in their writeup, as it appears in my browser window, the final L isn't visible on one of the command lines; it should of course say "mysql" rather than "mysq".

Also note that at least in some shells, you may have to run rehash after setting up the symlink.

Post a comment