Monday, 28 October 2013

Recover error : 1005 Can't create table 'tmp_db' (errno: 13)

While Altering table or changing Storage Engine of Database we may be got this error.
It happens probably due to Permission denied by MySQL.

less /etc/group
and then less /etc/passwd
find mysql user and group name, probably both are named mysql

change to mysql dir, probably var/lib/mysql and then type cd .. to go a dir under.

chown -R mysql:mysql ./mysql/

And also change permission of /tmp file 


By default the temporary file are directed to /tmp partition.
The permission in /tmp is different.

$ ls -ltrh /tmp
drwxr-xr-x  4 root root      4096 Jan 24 04:02 tmp


The group has no write permission on /tmp folder.

Fix :

Changed the permission of the /tmp folder and made the installation again

chmod 777 /tmp/

$ ls -ltrh /tmp

drwxrwxrwx  4 root root      4096 Jan 24 04:02 tmp


No comments:

Post a Comment