When I try to start

sudo service mysql start
start: Job failed to start

Then I look the /var/log/mysql/error.log

160122  8:43:42 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.
160122  8:43:42 [Note] Plugin 'FEDERATED' is disabled.
160122  8:43:42 InnoDB: The InnoDB memory heap is disabled
160122  8:43:42 InnoDB: Mutexes and rw_locks use GCC atomic builtins
160122  8:43:42 InnoDB: Compressed tables use zlib 1.2.8
160122  8:43:42 InnoDB: Using Linux native AIO
^G/usr/sbin/mysqld: Can't create/write to file '/tmp/ibv0Dwa6' (Errcode: 13)
160122  8:43:42  InnoDB: Error: unable to create temporary file; errno: 13
160122  8:43:42 [ERROR] Plugin 'InnoDB' init function returned error.
160122  8:43:42 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
160122  8:43:42 [ERROR] Unknown/unsupported storage engine: InnoDB
160122  8:43:42 [ERROR] Aborting

160122  8:43:42 [Note] /usr/sbin/mysqld: Shutdown complete

The permissions for /tmp

drwxr-xr-x   4 root root  4096 Jan 22 08:39 tmp

I also tried

sudo apt-get purge mysql-server-core-5.5 mysql-common

and to reinstall everything new.. But it didn't solve the problem. The socket /etc/mysql/my.cnf exists:

port            = 3306
socket          = /var/run/mysqld/mysqld.sock
socket          = /var/run/mysqld/mysqld.sock
nice            = 0

user            = mysql
pid-file        = /var/run/mysqld/mysqld.pid
socket          = /var/run/mysqld/mysqld.sock
port            = 3306
basedir         = /usr
datadir         = /var/lib/mysql
tmpdir          = /tmp
lc-messages-dir = /usr/share/mysql
bind-address            =
key_buffer              = 16M
max_allowed_packet      = 16M
thread_stack            = 192K
thread_cache_size       = 8
myisam-recover         = BACKUP
query_cache_limit       = 1M
query_cache_size        = 16M
log_error = /var/log/mysql/error.log
expire_logs_days        = 10
max_binlog_size         = 100M
max_allowed_packet      = 16M
key_buffer              = 16M
!includedir /etc/mysql/conf.d/


/var/run/mysqld I just saw this doesn't exist. How can I create this?


ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

When I try to connect.


The answer from Phil is the solution:

/tmp should be chmod'ed to 777 – Phil 2 days ago

sudo chmod 777 /tmp

(I can not set a comment as answer, so maybe some mod can change my answer to his?)


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.