MySQL server not starting – Part 4 !

When trying to restart the MySQL service, do you happen to find the following error in the logs ?

/usr/sbin/mysqld: Can’t create/write to file ‘/tmp/xx’ (Errcode: 122)
date InnoDB: Error: unable to create temporary file; errno: 122
date [ERROR] Can’t init databases
date [ERROR] Aborting

Under usual circumstances, this error can come up, when the permission of /tmp is inappropriate. The right one should be :

drwxrwxrwt  4 root root size date /tmp

( ie, it should be equivalent to # chmod 1777 /tmp )

You make sure this is the right one set for /tmp, you ensure that disk space aint full, still do you face this issue ?

– If so, check for the number of files and nature of them in /tmp. Delete unnecessary/unwanted hidden/temporary files and restart the service. This should fix it.