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.
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!
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
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
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”