Blue Static

MySQL in Leopard

Posted on December 4, 2007 at 16:36 UTC, filed under the category Uncategorized. Tags: leopard, mac os x, mysql,

Many people have been reporting issues with MySQL under Leopard with this error:

mysqld: Can't create/write to file '/var/folders/2F/2FtguLeuG1ibx1X9tbDS0E+++TI/-Tmp-/ibYWBjEU' (Errcode: 13)
071204 11:15:48  InnoDB: Error: unable to create temporary file; errno: 13

I have discovered a fix for this particular issue. First, in the Terminal, go into your MySQL root directory (mine is /usr/local/mysql). Then type these commands:

sudo mkdir tmp
sudo chown _mysql:wheel tmp
sudo chmod 755 tmp

This will create a temporary directory that MySQL will use. Now we have to make sure MySQL knows about this new location for temporary information, so open up your my.cnf and add this line:

tmpdir=/usr/local/mysql/tmp

(Where the path after the equals sign is the path to your tmp directory).

After this, restart MySQL and all should run fine.

Comments

Comment by Danny Bates on 2008-02-19 10:39:35 +0000

Thank you so much!

I’m so new to MySQL and your simple explanation and solution are perfect. Not too much, not too little. Seems others get too wordy with their experience and solutions, which generally causes confusion, but this hit the spot.

Thanks again!

Comment by evan on 2008-03-12 13:10:06 +0000

I am so lost. I am hoping that I can get a little help in the terminal and in finding where my.cnf is. I am brand new to programing and am still motivated to learn PHP and MySQL. Everything I am finding about fixing this in Leopard on my G4 is confusing.

Any help? my email is macursus(at)gmail(dot com)

thanks,

evan

Comment by Alexander on 2008-04-25 20:55:28 +0000

thanks for the great advice!

it helps to mention that

– my.cnf lives in /etc

– there is no /etc/my.cnf by default on Mac OS X

– tmpdir=/usr/local/mysql/tmp must be preceded by [mysqld] or mysql won’t start

so my /etc/my.cnf looks like this:

[mysqld]

tmpdir=/usr/local/mysql/tmp

Alexander

Comment by Aaron on 2008-07-28 23:00:00 +0000

Alexander, that was very helpful and important extra information, thanks. With that it works for me.

I will say that the original instructions say to “sudo chmod 755 tmp”

It will work, but more secure and just as functional is “sudo chmod 750 tmp”