I cannot start the MySQL server. My machine is an Ubuntu 14.04 with mysql-5.6
:
$> dpkg --get-selections | grep mysql
libdbd-mysql-perl install
libmysqlclient18:amd64 install
libqt4-sql-mysql:amd64 install
mysql-client-5.6 install
mysql-client-core-5.6 install
mysql-common install
mysql-common-5.6 install
mysql-server-5.6 install
mysql-server-core-5.6 install
php5-mysql install
That's the offending lines from /var/log/mysql/error.log
:
2017-11-06 20:10:54 9338 [Note] Plugin 'FEDERATED' is disabled.
2017-11-06 20:10:54 9338 [ERROR]
2017-11-06 20:10:54 9338 [Warning] Couldn't load plugin named 'innodb' with soname 'ha_innodb.so'.
2017-11-06 20:10:54 9338 [ERROR]
2017-11-06 20:10:54 9338 [Warning] Couldn't load plugin named 'federated' with soname 'ha_federated.so'.
2017-11-06 20:10:54 9338 [ERROR]
2017-11-06 20:10:54 9338 [Warning] Couldn't load plugin named 'blackhole' with soname 'ha_blackhole.so'.
2017-11-06 20:10:54 9338 [ERROR]
2017-11-06 20:10:54 9338 [Warning] Couldn't load plugin named 'archive' with soname 'ha_archive.so'.
Of course, any of those plugins exists in /usr/lib/mysql/plugin
. I don't know if they should be in any other directory, but for the error lines, it seems that the plugins are being looked up in standard directories since plugin names are not absolute paths.
When I try to restart the server, it freezes. The error when I try to connect is:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
But I think that the socket file is not being created because the start process has just not ended successfully.
This is not a fresh installation. I'm using the mysql serve since a couple of years ago. I didn't use the server during a while so I don't remember if I did some update that crashed something.
That's the full log of the last sudo service mysql start
(after a previous stop):
2017-11-06 20:26:23 29216 [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.
2017-11-06 20:26:23 29216 [Note] Plugin 'FEDERATED' is disabled.
2017-11-06 20:26:23 29216 [ERROR]
2017-11-06 20:26:23 29216 [Warning] Couldn't load plugin named 'innodb' with soname 'ha_innodb.so'.
2017-11-06 20:26:23 29216 [ERROR]
2017-11-06 20:26:23 29216 [Warning] Couldn't load plugin named 'federated' with soname 'ha_federated.so'.
2017-11-06 20:26:23 29216 [ERROR]
2017-11-06 20:26:23 29216 [Warning] Couldn't load plugin named 'blackhole' with soname 'ha_blackhole.so'.
2017-11-06 20:26:23 29216 [ERROR]
2017-11-06 20:26:23 29216 [Warning] Couldn't load plugin named 'archive' with soname 'ha_archive.so'.
2017-11-06 20:26:23 29216 [Note] InnoDB: Using atomics to ref count buffer pool pages
2017-11-06 20:26:23 29216 [Note] InnoDB: The InnoDB memory heap is disabled
2017-11-06 20:26:23 29216 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2017-11-06 20:26:23 29216 [Note] InnoDB: Memory barrier is not used
2017-11-06 20:26:23 29216 [Note] InnoDB: Compressed tables use zlib 1.2.8
2017-11-06 20:26:23 29216 [Note] InnoDB: Using Linux native AIO
2017-11-06 20:26:23 29216 [Note] InnoDB: Using CPU crc32 instructions
2017-11-06 20:26:23 29216 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2017-11-06 20:26:24 29216 [Note] InnoDB: Completed initialization of buffer pool
2017-11-06 20:26:24 29216 [Note] InnoDB: Highest supported file format is Barracuda.
2017-11-06 20:26:24 29216 [Note] InnoDB: 128 rollback segment(s) are active.
2017-11-06 20:26:24 29216 [Note] InnoDB: Waiting for purge to start
2017-11-06 20:26:24 29216 [Note] InnoDB: 5.6.33 started; log sequence number 415891008
2017-11-06 20:26:24 29216 [ERROR] Aborting
2017-11-06 20:26:24 29216 [Note] Binlog end
2017-11-06 20:26:24 29216 [Note] Shutting down plugin 'partition'
2017-11-06 20:26:24 29216 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2017-11-06 20:26:24 29216 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2017-11-06 20:26:24 29216 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2017-11-06 20:26:24 29216 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2017-11-06 20:26:24 29216 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2017-11-06 20:26:24 29216 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2017-11-06 20:26:24 29216 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2017-11-06 20:26:24 29216 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2017-11-06 20:26:24 29216 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2017-11-06 20:26:24 29216 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2017-11-06 20:26:24 29216 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2017-11-06 20:26:24 29216 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2017-11-06 20:26:24 29216 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2017-11-06 20:26:24 29216 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2017-11-06 20:26:24 29216 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2017-11-06 20:26:24 29216 [Note] Shutting down plugin 'INNODB_METRICS'
2017-11-06 20:26:24 29216 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2017-11-06 20:26:24 29216 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2017-11-06 20:26:24 29216 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2017-11-06 20:26:24 29216 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2017-11-06 20:26:24 29216 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2017-11-06 20:26:24 29216 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2017-11-06 20:26:24 29216 [Note] Shutting down plugin 'INNODB_CMPMEM'
2017-11-06 20:26:24 29216 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2017-11-06 20:26:24 29216 [Note] Shutting down plugin 'INNODB_CMP'
2017-11-06 20:26:24 29216 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2017-11-06 20:26:24 29216 [Note] Shutting down plugin 'INNODB_LOCKS'
2017-11-06 20:26:24 29216 [Note] Shutting down plugin 'INNODB_TRX'
2017-11-06 20:26:24 29216 [Note] Shutting down plugin 'InnoDB'
2017-11-06 20:26:24 29216 [Note] InnoDB: FTS optimize thread exiting.
2017-11-06 20:26:24 29216 [Note] InnoDB: Starting shutdown...
2017-11-06 20:26:25 29216 [Note] InnoDB: Shutdown completed; log sequence number 415891018
2017-11-06 20:26:25 29216 [Note] Shutting down plugin 'ARCHIVE'
2017-11-06 20:26:25 29216 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2017-11-06 20:26:25 29216 [Note] Shutting down plugin 'BLACKHOLE'
2017-11-06 20:26:25 29216 [Note] Shutting down plugin 'MEMORY'
2017-11-06 20:26:25 29216 [Note] Shutting down plugin 'MRG_MYISAM'
2017-11-06 20:26:25 29216 [Note] Shutting down plugin 'MyISAM'
2017-11-06 20:26:25 29216 [Note] Shutting down plugin 'CSV'
2017-11-06 20:26:25 29216 [Note] Shutting down plugin 'sha256_password'
2017-11-06 20:26:25 29216 [Note] Shutting down plugin 'mysql_old_password'
2017-11-06 20:26:25 29216 [Note] Shutting down plugin 'mysql_native_password'
2017-11-06 20:26:25 29216 [Note] Shutting down plugin 'binlog'
2017-11-06 20:26:25 29216 [Note]
That block of logging is repeated over and over because the server tries to start repeatedly.
After cancelling the start process, sudo service mysql status
throws:
mysql start/post-start, process 31967
post-start process 31968
Lastly (with comments removed),
$> cat /etc/mysql/my.cnf
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0
[mysqld]
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
skip-external-locking
bind-address = 127.0.0.1
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
[mysqldump]
quick
quote-names
max_allowed_packet = 16M
[mysql]
[isamchk]
key_buffer = 16M
!includedir /etc/mysql/conf.d/
mysql
butmysqld
. The user ismysql
and the grouproot
. The permissions of the folder arerwxr-xr-x
./var/run
, the foldermysqld
, which is empty and has the permissions I said above (rwxr-xr-x mysql:root
). Invar/lib
, I havemysql
(rwx------ mysql:mysql
),mysql-files
(rwx------ mysql:mysql
) andmysql-upgrade
(rxwr--xr--x root:root
).