Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mysql ERROR 1005 (HY000): Can't create table 'tmp' (errno: 13)

I'm Running Mysql on ubuntu 9.10, the process of Mysql is running as root, I'm using root account when logging to Mysql, which I gave all privileges, I'm using my own db(not mysql), I can create a table, but when i try to create Temporary table i get this error:

ERROR 1005 (HY000): Can't create table 'tmp' (errno: 13)

For this query:

CREATE TEMPORARY TABLE tmp (id int);

I've plenty of space in my hard drive, all permissions are granted(also var/lib/mysql have mysql permissions).

Any idea? Thanks, Koby

like image 552
koby Avatar asked Mar 19 '10 09:03

koby


2 Answers

I had the same issue a couple of weeks ago. The database folder on the filesystem was owned by the wrong user. A simple chown -R mysql:mysql /var/lib/mysql/database_name did the trick!

Everything's explained here: http://www.dinosources.eu/2010/10/mysql-cant-create-table (it's italian, but it's pretty clear)

Cheers

like image 158
Marchino Avatar answered Sep 18 '22 13:09

Marchino


Well... in /etc/mysql/my.cnf there's the "tmp" folder for use which is /tmp (from root) as default.. and do not have mysql privileges. chmod 0777 /tmp will do the trick

like image 37
koby Avatar answered Sep 20 '22 13:09

koby