Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

deansatch's avatar

Mysql goes down

Just noticed mysql went down for a few minutes. This is the log...any ideas what the cause could be?


2018-03-20T16:54:17.865993Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000)
2018-03-20T16:54:17.866081Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)
2018-03-20T16:54:18.030503Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-03-20T16:54:18.032406Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.21-0ubuntu0.16.04.1) starting as process 22733 ...
2018-03-20T16:54:18.038007Z 0 [Note] InnoDB: PUNCH HOLE support available
2018-03-20T16:54:18.038049Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-03-20T16:54:18.038059Z 0 [Note] InnoDB: Uses event mutexes
2018-03-20T16:54:18.038065Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2018-03-20T16:54:18.038072Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.8
2018-03-20T16:54:18.038078Z 0 [Note] InnoDB: Using Linux native AIO
2018-03-20T16:54:18.038379Z 0 [Note] InnoDB: Number of pools: 1
2018-03-20T16:54:18.038522Z 0 [Note] InnoDB: Using CPU crc32 instructions
2018-03-20T16:54:18.040492Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2018-03-20T16:54:18.050071Z 0 [Note] InnoDB: Completed initialization of buffer pool
2018-03-20T16:54:18.052516Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2018-03-20T16:54:18.070163Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2018-03-20T16:54:18.072329Z 0 [Note] InnoDB: Log scan progressed past the checkpoint lsn 39365648
2018-03-20T16:54:18.072360Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 39365657
2018-03-20T16:54:18.072370Z 0 [Note] InnoDB: Database was not shutdown normally!
2018-03-20T16:54:18.072389Z 0 [Note] InnoDB: Starting crash recovery.
2018-03-20T16:54:18.239588Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2018-03-20T16:54:18.239634Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2018-03-20T16:54:18.239698Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2018-03-20T16:54:18.268402Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2018-03-20T16:54:18.269730Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2018-03-20T16:54:18.269753Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2018-03-20T16:54:18.270515Z 0 [Note] InnoDB: Waiting for purge to start
2018-03-20T16:54:18.320775Z 0 [Note] InnoDB: 5.7.21 started; log sequence number 39365657
2018-03-20T16:54:18.321824Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2018-03-20T16:54:18.322183Z 0 [Note] Plugin 'FEDERATED' is disabled.
2018-03-20T16:54:18.329836Z 0 [Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key
2018-03-20T16:54:18.329865Z 0 [Note] Server hostname (bind-address): '127.0.0.1'; port: 3306
2018-03-20T16:54:18.329879Z 0 [Note]   - '127.0.0.1' resolves to '127.0.0.1';
2018-03-20T16:54:18.329914Z 0 [Note] Server socket created on IP: '127.0.0.1'.
2018-03-20T16:54:18.338620Z 0 [Note] InnoDB: Buffer pool(s) load completed at 180320 16:54:18
2018-03-20T16:54:18.359917Z 0 [Note] Event Scheduler: Loaded 0 events
2018-03-20T16:54:18.360114Z 0 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.7.21-0ubuntu0.16.04.1'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  (Ubuntu)
2018-03-20T16:54:18.870806Z 2 [Note] Access denied for user 'root'@'localhost' (using password: NO)


0 likes
7 replies
Thyrosis's avatar

This log seems to start from the moment your MySQL server has already crashed and is now recovering by starting up again.

I think you might need to scroll a bit further up to find a possible reason it crashed.

deansatch's avatar

@Thyrosis - here is the whole file


2018-03-20T09:50:20.352122Z 31702 [Note] Aborted connection 31702 to db: 'unconnected' user: 'xxxx' host: 'localhost' (Got an error reading communication packets)
2018-03-20T09:50:20.352276Z 31701 [Note] Aborted connection 31701 to db: 'xxxx' user: 'xxxx' host: 'localhost' (Got an error reading communication packets)
2018-03-20T16:53:47.637226Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000)
2018-03-20T16:53:47.645002Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)
2018-03-20T16:53:48.138787Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-03-20T16:53:48.145802Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.21-0ubuntu0.16.04.1) starting as process 22518 ...
2018-03-20T16:53:48.162467Z 0 [Note] InnoDB: PUNCH HOLE support available
2018-03-20T16:53:48.162504Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-03-20T16:53:48.162526Z 0 [Note] InnoDB: Uses event mutexes
2018-03-20T16:53:48.162534Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2018-03-20T16:53:48.162541Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.8
2018-03-20T16:53:48.162547Z 0 [Note] InnoDB: Using Linux native AIO
2018-03-20T16:53:48.163287Z 0 [Note] InnoDB: Number of pools: 1
2018-03-20T16:53:48.164001Z 0 [Note] InnoDB: Using CPU crc32 instructions
2018-03-20T16:53:48.168087Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2018-03-20T16:53:48.168443Z 0 [ERROR] InnoDB: mmap(137428992 bytes) failed; errno 12
2018-03-20T16:53:48.168465Z 0 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
2018-03-20T16:53:48.168474Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2018-03-20T16:53:48.168486Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2018-03-20T16:53:48.168492Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2018-03-20T16:53:48.168500Z 0 [ERROR] Failed to initialize builtin plugins.
2018-03-20T16:53:48.168505Z 0 [ERROR] Aborting

2018-03-20T16:53:48.168518Z 0 [Note] Binlog end
2018-03-20T16:53:48.170083Z 0 [Note] /usr/sbin/mysqld: Shutdown complete

2018-03-20T16:54:17.865993Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000)
2018-03-20T16:54:17.866081Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)
2018-03-20T16:54:18.030503Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-03-20T16:54:18.032406Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.21-0ubuntu0.16.04.1) starting as process 22733 ...
2018-03-20T16:54:18.038007Z 0 [Note] InnoDB: PUNCH HOLE support available
2018-03-20T16:54:18.038049Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-03-20T16:54:18.038059Z 0 [Note] InnoDB: Uses event mutexes
2018-03-20T16:54:18.038065Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2018-03-20T16:54:18.038072Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.8
2018-03-20T16:54:18.038078Z 0 [Note] InnoDB: Using Linux native AIO
2018-03-20T16:54:18.038379Z 0 [Note] InnoDB: Number of pools: 1
2018-03-20T16:54:18.038522Z 0 [Note] InnoDB: Using CPU crc32 instructions
2018-03-20T16:54:18.040492Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2018-03-20T16:54:18.050071Z 0 [Note] InnoDB: Completed initialization of buffer pool
2018-03-20T16:54:18.052516Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2018-03-20T16:54:18.070163Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2018-03-20T16:54:18.072329Z 0 [Note] InnoDB: Log scan progressed past the checkpoint lsn 39365648
2018-03-20T16:54:18.072360Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 39365657
2018-03-20T16:54:18.072370Z 0 [Note] InnoDB: Database was not shutdown normally!
2018-03-20T16:54:18.072389Z 0 [Note] InnoDB: Starting crash recovery.
2018-03-20T16:54:18.239588Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2018-03-20T16:54:18.239634Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2018-03-20T16:54:18.239698Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2018-03-20T16:54:18.268402Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2018-03-20T16:54:18.269730Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2018-03-20T16:54:18.269753Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2018-03-20T16:54:18.270515Z 0 [Note] InnoDB: Waiting for purge to start
2018-03-20T16:54:18.320775Z 0 [Note] InnoDB: 5.7.21 started; log sequence number 39365657
2018-03-20T16:54:18.321824Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2018-03-20T16:54:18.322183Z 0 [Note] Plugin 'FEDERATED' is disabled.
2018-03-20T16:54:18.329836Z 0 [Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key
2018-03-20T16:54:18.329865Z 0 [Note] Server hostname (bind-address): '127.0.0.1'; port: 3306
2018-03-20T16:54:18.329879Z 0 [Note]   - '127.0.0.1' resolves to '127.0.0.1';
2018-03-20T16:54:18.329914Z 0 [Note] Server socket created on IP: '127.0.0.1'.
2018-03-20T16:54:18.338620Z 0 [Note] InnoDB: Buffer pool(s) load completed at 180320 16:54:18
2018-03-20T16:54:18.359917Z 0 [Note] Event Scheduler: Loaded 0 events
2018-03-20T16:54:18.360114Z 0 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.7.21-0ubuntu0.16.04.1'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  (Ubuntu)
2018-03-20T16:54:18.870806Z 2 [Note] Access denied for user 'xxxx'@'localhost' (using password: NO)


rin4ik's avatar

append these two lines to /etc/security/limits.conf

mysql hard nofile 65535
mysql soft nofile 65535

append this line to /usr/lib/systemd/system/mysqld.service (in the [service] section)

LimitNOFILE=65535

then finally reboot and check that those error messages have disappeared from your mysql error log. Stackowerflow

deansatch's avatar

Is that not just to stop warning in the log file? I'm more concerned with why mysql keeps shutting down and restarting

afraz's avatar

I also faced this issue and searched a lot only one solution worked for me.

Just copy all files from C:\xampp\mysql\backup to C:\xampp\mysql\data

Make sure to take backup of your data folder to avoid any further problems

Please or to participate in this conversation.