I
I
IvanSerr2021-02-10 16:47:06
MySQL
IvanSerr, 2021-02-10 16:47:06

How to fix mysql docker container?

Host: CentOS 7, after restarting the server, the docker container with mysql database stopped rising

2021-02-10T13:12:40.364242Z 0 [ERROR] Could not open unix socket lock file /var/run/mysqld/mysqld.sock.lock.
2021-02-10T13:12:40.364250Z 0 [ERROR] Unable to setup unix socket lock file.
2021-02-10T13:12:40.364255Z 0 [ERROR] Aborting

I understand that mysql can't create mysqld.sock.lock, but how do I fix this or connect to an aborted container (if at all possible) ?

How, in general, to be in such a situation?

Full log below

spoiler
2021-02-10 13:12:39+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.33-1debian10 started.
2021-02-10 13:12:39+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2021-02-10 13:12:39+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.33-1debian10 started.
2021-02-10T13:12:40.055218Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2021-02-10T13:12:40.059199Z 0 [Note] mysqld (mysqld 5.7.33) starting as process 1 ...
2021-02-10T13:12:40.064328Z 0 [Note] InnoDB: PUNCH HOLE support available
2021-02-10T13:12:40.064349Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2021-02-10T13:12:40.064353Z 0 [Note] InnoDB: Uses event mutexes
2021-02-10T13:12:40.064357Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2021-02-10T13:12:40.064360Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2021-02-10T13:12:40.064364Z 0 [Note] InnoDB: Using Linux native AIO
2021-02-10T13:12:40.064664Z 0 [Note] InnoDB: Number of pools: 1
2021-02-10T13:12:40.064808Z 0 [Note] InnoDB: Using CPU crc32 instructions
2021-02-10T13:12:40.066771Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2021-02-10T13:12:40.075161Z 0 [Note] InnoDB: Completed initialization of buffer pool
2021-02-10T13:12:40.078213Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2021-02-10T13:12:40.112290Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2021-02-10T13:12:40.179949Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2021-02-10T13:12:40.180039Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2021-02-10T13:12:40.285134Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2021-02-10T13:12:40.286642Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2021-02-10T13:12:40.286671Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2021-02-10T13:12:40.288076Z 0 [Note] InnoDB: Waiting for purge to start
2021-02-10T13:12:40.338432Z 0 [Note] InnoDB: 5.7.33 started; log sequence number 53305160
2021-02-10T13:12:40.339415Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2021-02-10T13:12:40.339869Z 0 [Note] Plugin 'FEDERATED' is disabled.
2021-02-10T13:12:40.353272Z 0 [Note] InnoDB: Buffer pool(s) load completed at 210210 13:12:40
2021-02-10T13:12:40.358497Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
2021-02-10T13:12:40.358528Z 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory.
2021-02-10T13:12:40.361728Z 0 [Warning] CA certificate ca.pem is self signed.
2021-02-10T13:12:40.361793Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.
2021-02-10T13:12:40.364000Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
2021-02-10T13:12:40.364063Z 0 [Note] IPv6 is available.
2021-02-10T13:12:40.364075Z 0 [Note] - '::' resolves to '::';
2021-02-10T13:12:40.364104Z 0 [Note] Server socket created on IP: '::'.
2021-02-10T13:12:40.364242Z 0 [ERROR] Could not open unix socket lock file /var/run/mysqld/mysqld.sock.lock.
2021-02-10T13:12:40.364250Z 0 [ERROR] Unable to setup unix socket lock file.
2021-02-10T13:12:40.364255Z 0 [ERROR] Aborting

2021-02-10T13:12:40.364267Z 0 [Note] Binlog end
2021-02-10T13:12:40.364334Z 0 [Note] Shutting down plugin 'ngram'
2021-02-10T13:12:40.364346Z 0 [Note] Shutting down plugin 'partition'
2021-02-10T13:12:40.364349Z 0 [Note] Shutting down plugin 'BLACKHOLE'
2021-02-10T13:12:40.364353Z 0 [Note] Shutting down plugin 'ARCHIVE'
2021-02-10T13:12:40.364356Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2021-02-10T13:12:40.364426Z 0 [Note] Shutting down plugin 'MRG_MYISAM'
2021-02-10T13:12:40.364431Z 0 [Note] Shutting down plugin 'MyISAM'
2021-02-10T13:12:40.364448Z 0 [Note] Shutting down plugin 'INNODB_SYS_VIRTUAL'
2021-02-10T13:12:40.364465Z 0 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2021-02-10T13:12:40.364468Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2021-02-10T13:12:40.364471Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2021-02-10T13:12:40.364474Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2021-02-10T13:12:40.364477Z 0 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2021-02-10T13:12:40.364480Z 0 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2021-02-10T13:12:40.364483Z 0 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2021-02-10T13:12:40.364486Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2021-02-10T13:12:40.364488Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2021-02-10T13:12:40.364491Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2021-02-10T13:12:40.364494Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2021-02-10T13:12:40.364497Z 0 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2021-02-10T13:12:40.364500Z 0 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2021-02-10T13:12:40.364502Z 0 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2021-02-10T13:12:40.364505Z 0 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2021-02-10T13:12:40.364508Z 0 [Note] Shutting down plugin 'INNODB_METRICS'
2021-02-10T13:12:40.364510Z 0 [Note] Shutting down plugin 'INNODB_TEMP_TABLE_INFO'
2021-02-10T13:12:40.364513Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2021-02-10T13:12:40.364518Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2021-02-10T13:12:40.364521Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2021-02-10T13:12:40.364524Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2021-02-10T13:12:40.364527Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2021-02-10T13:12:40.364530Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2021-02-10T13:12:40.364533Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM'
2021-02-10T13:12:40.364535Z 0 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2021-02-10T13:12:40.364538Z 0 [Note] Shutting down plugin 'INNODB_CMP'
2021-02-10T13:12:40.364542Z 0 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2021-02-10T13:12:40.364544Z 0 [Note] Shutting down plugin 'INNODB_LOCKS'
2021-02-10T13:12:40.364547Z 0 [Note] Shutting down plugin 'INNODB_TRX'
2021-02-10T13:12:40.364551Z 0 [Note] Shutting down plugin 'InnoDB'
2021-02-10T13:12:40.364631Z 0 [Note] InnoDB: FTS optimize thread exiting.
2021-02-10T13:12:40.364860Z 0 [Note] InnoDB: Starting shutdown...
2021-02-10T13:12:40.465678Z 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
2021-02-10T13:12:40.466736Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 210210 13:12:40
2021-02-10T13:12:41.979746Z 0 [Note] InnoDB: Shutdown completed; log sequence number 53305179
2021-02-10T13:12:41.984419Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2021-02-10T13:12:41.984487Z 0 [Note] Shutting down plugin 'MEMORY'
2021-02-10T13:12:41.984504Z 0 [Note] Shutting down plugin 'CSV'
2021-02-10T13:12:41.984514Z 0 [Note] Shutting down plugin 'sha256_password'
2021-02-10T13:12:41.984521Z 0 [Note] Shutting down plugin 'mysql_native_password'
2021-02-10T13:12:41.984797Z 0 [Note] Shutting down plugin 'binlog'
2021-02-10T13:12:41.985769Z 0 [Note] mysqld: Shutdown complete

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Romses Panagiotis, 2021-02-10
@romesses

If there is a (current) backup copy of the data, then it is worth restoring from it. This will be the fastest way.
If there is no backup, then try this article:
https://dev.mysql.com/doc/refman/5.7/en/innodb-rec...
And here's how to actually extract data from the container:
https:// morioh.com/p/dbde4658c10e
Next time, mount the data to the container and set up regular backups.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question