Changing tmpdir in my.cnf causes mysql to fail to restart - mysql

I'm trying to change where mysql uses for temporary tables. I have a drive mounted at /media/E, and I've created a directory owned by root with permissions drwxrwxrwxt at /media/E/tmp.
I have changed tmpdir in /etc/mysql/mysql.conf.d/mysqld.cnf to point to this directory.
I then restart mysql like so:
username#grey:/media/E/tmp$ sudo service mysql restart
Yielding the following error:
Job for mysql.service failed because the control process exited with error code.
See "systemctl status mysql.service" and "journalctl -xe" for details.
Here is the result of systemctl status mysql.service:
● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2021-08-05 16:56:07 BST; 3min 11s ago
Process: 28964 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/run/mysqld/mysqld.pid (code=exited, status=1/FAILURE)
Process: 28938 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
Main PID: 24216 (code=exited, status=0/SUCCESS)
Aug 05 16:56:07 computer systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
Aug 05 16:56:07 computer systemd[1]: mysql.service: Scheduled restart job, restart counter is at 5.
Aug 05 16:56:07 computer systemd[1]: Stopped MySQL Community Server.
Aug 05 16:56:07 computer systemd[1]: mysql.service: Start request repeated too quickly.
Aug 05 16:56:07 computer systemd[1]: mysql.service: Failed with result 'exit-code'.
Aug 05 16:56:07 computer systemd[1]: Failed to start MySQL Community Server.
mysql error.log:
2021-08-05T15:56:05.385461Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2021-08-05T15:56:05.387065Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.35-0ubuntu0.18.04.1) starting as process 28785 ...
2021-08-05T15:56:05.391963Z 0 [Note] InnoDB: PUNCH HOLE support available
2021-08-05T15:56:05.391993Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2021-08-05T15:56:05.391999Z 0 [Note] InnoDB: Uses event mutexes
2021-08-05T15:56:05.392004Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2021-08-05T15:56:05.392009Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2021-08-05T15:56:05.392014Z 0 [Note] InnoDB: Using Linux native AIO
2021-08-05T15:56:05.392223Z 0 [Note] InnoDB: Number of pools: 1
2021-08-05T15:56:05.392308Z 0 [Note] InnoDB: Using CPU crc32 instructions
mysqld: Can't create/write to file '/media/E/tmp/ib0OZZH0' (Errcode: 13 - Permission denied)
2021-08-05T15:56:05.392355Z 0 [ERROR] InnoDB: Unable to create temporary file; errno: 13
2021-08-05T15:56:05.392362Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2021-08-05T15:56:05.392368Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2021-08-05T15:56:05.392372Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2021-08-05T15:56:05.392376Z 0 [ERROR] Failed to initialize builtin plugins.
2021-08-05T15:56:05.392380Z 0 [ERROR] Aborting
2021-08-05T15:56:05.392398Z 0 [Note] Binlog end
2021-08-05T15:56:05.392455Z 0 [Note] Shutting down plugin 'CSV'
2021-08-05T15:56:05.392742Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
2021-08-05T15:56:05.922766Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2021-08-05T15:56:05.924030Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.35-0ubuntu0.18.04.1) starting as process 28830 ...
2021-08-05T15:56:05.927684Z 0 [Note] InnoDB: PUNCH HOLE support available
2021-08-05T15:56:05.927705Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2021-08-05T15:56:05.927711Z 0 [Note] InnoDB: Uses event mutexes
2021-08-05T15:56:05.927716Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2021-08-05T15:56:05.927720Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2021-08-05T15:56:05.927725Z 0 [Note] InnoDB: Using Linux native AIO
2021-08-05T15:56:05.927922Z 0 [Note] InnoDB: Number of pools: 1
2021-08-05T15:56:05.928009Z 0 [Note] InnoDB: Using CPU crc32 instructions
mysqld: Can't create/write to file '/media/E/tmp/ibTpGlkH' (Errcode: 13 - Permission denied)
2021-08-05T15:56:05.928121Z 0 [ERROR] InnoDB: Unable to create temporary file; errno: 13
2021-08-05T15:56:05.928128Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2021-08-05T15:56:05.928133Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2021-08-05T15:56:05.928136Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2021-08-05T15:56:05.928140Z 0 [ERROR] Failed to initialize builtin plugins.
2021-08-05T15:56:05.928143Z 0 [ERROR] Aborting
2021-08-05T15:56:05.928160Z 0 [Note] Binlog end
2021-08-05T15:56:05.928199Z 0 [Note] Shutting down plugin 'CSV'
2021-08-05T15:56:05.928422Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
2021-08-05T15:56:06.432240Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2021-08-05T15:56:06.433500Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.35-0ubuntu0.18.04.1) starting as process 28876 ...
2021-08-05T15:56:06.437655Z 0 [Note] InnoDB: PUNCH HOLE support available
2021-08-05T15:56:06.437707Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2021-08-05T15:56:06.437716Z 0 [Note] InnoDB: Uses event mutexes
2021-08-05T15:56:06.437724Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2021-08-05T15:56:06.437732Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2021-08-05T15:56:06.437740Z 0 [Note] InnoDB: Using Linux native AIO
2021-08-05T15:56:06.438087Z 0 [Note] InnoDB: Number of pools: 1
2021-08-05T15:56:06.438218Z 0 [Note] InnoDB: Using CPU crc32 instructions
mysqld: Can't create/write to file '/media/E/tmp/ibuYEQaa' (Errcode: 13 - Permission denied)
2021-08-05T15:56:06.438274Z 0 [ERROR] InnoDB: Unable to create temporary file; errno: 13
2021-08-05T15:56:06.438285Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2021-08-05T15:56:06.438293Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2021-08-05T15:56:06.438299Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2021-08-05T15:56:06.438306Z 0 [ERROR] Failed to initialize builtin plugins.
2021-08-05T15:56:06.438311Z 0 [ERROR] Aborting
2021-08-05T15:56:06.438338Z 0 [Note] Binlog end
2021-08-05T15:56:06.438394Z 0 [Note] Shutting down plugin 'CSV'
2021-08-05T15:56:06.438799Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
2021-08-05T15:56:06.933005Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2021-08-05T15:56:06.934428Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.35-0ubuntu0.18.04.1) starting as process 28919 ...
2021-08-05T15:56:06.938763Z 0 [Note] InnoDB: PUNCH HOLE support available
2021-08-05T15:56:06.938803Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2021-08-05T15:56:06.938812Z 0 [Note] InnoDB: Uses event mutexes
2021-08-05T15:56:06.938820Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2021-08-05T15:56:06.938828Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2021-08-05T15:56:06.938836Z 0 [Note] InnoDB: Using Linux native AIO
2021-08-05T15:56:06.939095Z 0 [Note] InnoDB: Number of pools: 1
2021-08-05T15:56:06.939192Z 0 [Note] InnoDB: Using CPU crc32 instructions
mysqld: Can't create/write to file '/media/E/tmp/ibrNdqJK' (Errcode: 13 - Permission denied)
2021-08-05T15:56:06.939294Z 0 [ERROR] InnoDB: Unable to create temporary file; errno: 13
2021-08-05T15:56:06.939305Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2021-08-05T15:56:06.939311Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2021-08-05T15:56:06.939317Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2021-08-05T15:56:06.939323Z 0 [ERROR] Failed to initialize builtin plugins.
2021-08-05T15:56:06.939328Z 0 [ERROR] Aborting
2021-08-05T15:56:06.939373Z 0 [Note] Binlog end
2021-08-05T15:56:06.939481Z 0 [Note] Shutting down plugin 'CSV'
2021-08-05T15:56:06.939965Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
2021-08-05T15:56:07.433078Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2021-08-05T15:56:07.434360Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.35-0ubuntu0.18.04.1) starting as process 28966 ...
2021-08-05T15:56:07.438280Z 0 [Note] InnoDB: PUNCH HOLE support available
2021-08-05T15:56:07.438321Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2021-08-05T15:56:07.438326Z 0 [Note] InnoDB: Uses event mutexes
2021-08-05T15:56:07.438331Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2021-08-05T15:56:07.438335Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2021-08-05T15:56:07.438340Z 0 [Note] InnoDB: Using Linux native AIO
2021-08-05T15:56:07.438590Z 0 [Note] InnoDB: Number of pools: 1
2021-08-05T15:56:07.438678Z 0 [Note] InnoDB: Using CPU crc32 instructions
mysqld: Can't create/write to file '/media/E/tmp/ibr3ovUd' (Errcode: 13 - Permission denied)
2021-08-05T15:56:07.438726Z 0 [ERROR] InnoDB: Unable to create temporary file; errno: 13
2021-08-05T15:56:07.438733Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2021-08-05T15:56:07.438738Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2021-08-05T15:56:07.438742Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2021-08-05T15:56:07.438747Z 0 [ERROR] Failed to initialize builtin plugins.
2021-08-05T15:56:07.438750Z 0 [ERROR] Aborting
2021-08-05T15:56:07.438773Z 0 [Note] Binlog end
2021-08-05T15:56:07.438824Z 0 [Note] Shutting down plugin 'CSV'
2021-08-05T15:56:07.439214Z 0 [Note] /usr/sbin/mysqld: Shutdown complete

MySQL is armored by AppArmor, which does not allow writing freely to /media/E/tmp. To remedy the situation, you can edit the /etc/apparmor.d/abstractions/user-tmp and add the /media/E/tmp there appropriately; for me the extra lines
owner /media/E/tmp/** rwkl,
/media/E/tmp/ rw,

Related

Mgt Development Environment - MySQL suddenly won't start

I have 4 containers using mgt-commerce/mgt-development-environment-7.2. Basically everything runs well until I cannot access the control panel. It returns 500.
After checking the services, logs, etc, it seems like mysql is unable to start. Here is the error log captured in /var/log/mysql/error.log during starting mysql service using sudo service mysql start.
2019-09-26T23:38:43.740283Z mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
2019-09-26T23:38:43.921450Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.26-29) starting as process 1576 ...
2019-09-26T23:38:43.924613Z 0 [Note] InnoDB: PUNCH HOLE support available
2019-09-26T23:38:43.924635Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2019-09-26T23:38:43.924639Z 0 [Note] InnoDB: Uses event mutexes
2019-09-26T23:38:43.924642Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2019-09-26T23:38:43.924644Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2019-09-26T23:38:43.924647Z 0 [Note] InnoDB: Using Linux native AIO
2019-09-26T23:38:43.924859Z 0 [Note] InnoDB: Number of pools: 1
2019-09-26T23:38:43.924920Z 0 [Note] InnoDB: Using CPU crc32 instructions
2019-09-26T23:38:43.925849Z 0 [Note] InnoDB: Initializing buffer pool, total size = 1G, instances = 8, chunk size = 128M
2019-09-26T23:38:43.946744Z 0 [Note] InnoDB: Completed initialization of buffer pool
2019-09-26T23:38:43.955252Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2019-09-26T23:38:43.966654Z 0 [Note] InnoDB: Recovering partial pages from the parallel doublewrite buffer at /var/lib/mysql/xb_doublewrite
2019-09-26T23:38:44.033822Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2019-09-26T23:38:44.033986Z 0 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2019-09-26T23:38:44.034023Z 0 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
2019-09-26T23:38:44.034040Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2019-09-26T23:38:45.135220Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2019-09-26T23:38:45.135270Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2019-09-26T23:38:45.135283Z 0 [ERROR] Failed to initialize builtin plugins.
2019-09-26T23:38:45.135291Z 0 [ERROR] Aborting
2019-09-26T23:38:45.135301Z 0 [Note] Binlog end
2019-09-26T23:38:45.135371Z 0 [Note] Shutting down plugin 'CSV'
2019-09-26T23:38:45.136207Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
Is there anyone using this image ever getting this kind of error?
Update
It seems like mysql doesn't have the access to a particular file(s) or directory(ies), but I'm not sure which file(s) or directory(ies) . Here is the permission of mysql data directory:
clp#magento2dev:/$ ls -la /var/lib | grep mysql
drwxr-x--- 1 mysql mysql 4096 Sep 26 23:38 mysql
drwxrwx--- 2 mysql mysql 4096 Jul 11 15:24 mysql-files
drwxr-x--- 2 mysql mysql 4096 Jul 11 15:24 mysql-keyring

LINUX MINT mysql

ERROR LINUX MINT MYSQL
Can You explain what happened?
I can't start in xampp
What configuration should I change ?
I already change /var/lib/mysql/ to chmod 777
2019-02-27T16:35:55.748379Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000)
2019-02-27T16:35:55.748447Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)
2019-02-27T16:35:55.919606Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2019-02-27T16:35:55.921605Z 0 [Note] mysqld (mysqld 5.7.25-0ubuntu0.18.04.2) starting as process 16788 ...
2019-02-27T16:35:55.926137Z 0 [Note] InnoDB: PUNCH HOLE support available
2019-02-27T16:35:55.926173Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2019-02-27T16:35:55.926182Z 0 [Note] InnoDB: Uses event mutexes
2019-02-27T16:35:55.926190Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2019-02-27T16:35:55.926198Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2019-02-27T16:35:55.926206Z 0 [Note] InnoDB: Using Linux native AIO
2019-02-27T16:35:55.926511Z 0 [Note] InnoDB: Number of pools: 1
2019-02-27T16:35:55.926644Z 0 [Note] InnoDB: Using CPU crc32 instructions
2019-02-27T16:35:55.928888Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2019-02-27T16:35:55.945234Z 0 [Note] InnoDB: Completed initialization of buffer pool
2019-02-27T16:35:55.948312Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2019-02-27T16:35:55.958383Z 0 [ERROR] InnoDB: The innodb_system data file 'ibdata1' must be writable
2019-02-27T16:35:55.958517Z 0 [ERROR] InnoDB: The innodb_system data file 'ibdata1' must be writable
2019-02-27T16:35:55.958539Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2019-02-27T16:35:56.559302Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2019-02-27T16:35:56.559365Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2019-02-27T16:35:56.559381Z 0 [ERROR] Failed to initialize builtin plugins.
2019-02-27T16:35:56.559404Z 0 [ERROR] Aborting
2019-02-27T16:35:56.559441Z 0 [Note] Binlog end
2019-02-27T16:35:56.559583Z 0 [Note] Shutting down plugin 'CSV'
2019-02-27T16:35:56.560410Z 0 [Note] mysqld: Shutdown complete
You must check rights on your filesystem :
The innodb_system data file 'ibdata1' must be writable
The folder containing ibdata1 seems to not be writable by mysql user.
I have the same problem and the file ibdata1 is indeed writable -rw-rw--w-.
The full path of this file is at /usr/local/var/mysql/ibdata1.
But it doen't help if I make the file writable by all -- I get the same error.
Stumbled upon an answer by remove *.err and it did it for me! Hope it helps you.

MAMP Pro MySQL Won't Start

I have tried everything from every forum, still no love. Deleted temp files, even a totally clean re-install.
Even created a new user on my Mac.... same issue.
Here's the MySQL log file:
2018-12-15T09:47:47.6NZ mysqld_safe Logging to '/Applications/MAMP/logs/mysql_error.log'.
2018-12-15T09:47:47.6NZ mysqld_safe Starting mysqld daemon with databases from /Library/Application Support/appsolute/MAMP PRO/db/mysql57
2018-12-15T09:47:48.230415Z 0 [Warning] Insecure configuration for --secure-file-priv: Current value does not restrict location of generated files. Consider setting it to a valid, non-empty path.
2018-12-15T09:47:48.232313Z 0 [Note] /Applications/MAMP/Library/bin/mysqld (mysqld 5.7.23) starting as process 3631 ...
2018-12-15T09:47:48.249599Z 0 [Warning] Setting lower_case_table_names=2 because file system for /Library/Application Support/appsolute/MAMP PRO/db/mysql57/ is case insensitive
2018-12-15T09:47:48.266106Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-12-15T09:47:48.266181Z 0 [Note] InnoDB: Uses event mutexes
2018-12-15T09:47:48.266203Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2018-12-15T09:47:48.266221Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2018-12-15T09:47:48.266277Z 0 [Note] InnoDB: Adjusting innodb_buffer_pool_instances from 8 to 1 since innodb_buffer_pool_size is less than 1024 MiB
2018-12-15T09:47:48.269905Z 0 [Note] InnoDB: Number of pools: 1
2018-12-15T09:47:48.273776Z 0 [Note] InnoDB: Using CPU crc32 instructions
2018-12-15T09:47:48.279178Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2018-12-15T09:47:48.301106Z 0 [Note] InnoDB: Completed initialization of buffer pool
2018-12-15T09:47:48.335445Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2018-12-15T09:47:48.339844Z 0 [ERROR] InnoDB: Ignoring the redo log due to missing MLOG_CHECKPOINT between the checkpoint 72309002 and the end 72308736.
2018-12-15T09:47:48.339913Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2018-12-15T09:47:48.642547Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2018-12-15T09:47:48.642595Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2018-12-15T09:47:48.642616Z 0 [ERROR] Failed to initialize builtin plugins.
2018-12-15T09:47:48.642631Z 0 [ERROR] Aborting
2018-12-15T09:47:48.643113Z 0 [Note] Binlog end
2018-12-15T09:47:48.644288Z 0 [Note] Shutting down plugin 'CSV'
2018-12-15T09:47:48.645917Z 0 [Note] /Applications/MAMP/Library/bin/mysqld: Shutdown complete
2018-12-15T09:47:48.6NZ mysqld_safe mysqld from pid file /Applications/MAMP/tmp/mysql/mysql.pid ended
2018-12-15T09:58:04.6NZ mysqld_safe Logging to '/Applications/MAMP/logs/mysql_error.log'.
2018-12-15T09:58:04.6NZ mysqld_safe Starting mysqld daemon with databases from /Library/Application Support/appsolute/MAMP PRO/db/mysql57
2018-12-15T09:58:05.259005Z 0 [Warning] Insecure configuration for --secure-file-priv: Current value does not restrict location of generated files. Consider setting it to a valid, non-empty path.
2018-12-15T09:58:05.261261Z 0 [Note] /Applications/MAMP/Library/bin/mysqld (mysqld 5.7.23) starting as process 4301 ...
2018-12-15T09:58:05.280531Z 0 [Warning] Setting lower_case_table_names=2 because file system for /Library/Application Support/appsolute/MAMP PRO/db/mysql57/ is case insensitive
2018-12-15T09:58:05.298055Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-12-15T09:58:05.298134Z 0 [Note] InnoDB: Uses event mutexes
2018-12-15T09:58:05.298163Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2018-12-15T09:58:05.298189Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2018-12-15T09:58:05.298249Z 0 [Note] InnoDB: Adjusting innodb_buffer_pool_instances from 8 to 1 since innodb_buffer_pool_size is less than 1024 MiB
2018-12-15T09:58:05.301851Z 0 [Note] InnoDB: Number of pools: 1
2018-12-15T09:58:05.306424Z 0 [Note] InnoDB: Using CPU crc32 instructions
2018-12-15T09:58:05.310212Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2018-12-15T09:58:05.334016Z 0 [Note] InnoDB: Completed initialization of buffer pool
2018-12-15T09:58:05.390575Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2018-12-15T09:58:05.395800Z 0 [ERROR] InnoDB: Ignoring the redo log due to missing MLOG_CHECKPOINT between the checkpoint 72309002 and the end 72308736.
2018-12-15T09:58:05.395949Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2018-12-15T09:58:05.706951Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2018-12-15T09:58:05.707019Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2018-12-15T09:58:05.707057Z 0 [ERROR] Failed to initialize builtin plugins.
2018-12-15T09:58:05.707106Z 0 [ERROR] Aborting
2018-12-15T09:58:05.707807Z 0 [Note] Binlog end
2018-12-15T09:58:05.709523Z 0 [Note] Shutting down plugin 'CSV'
2018-12-15T09:58:05.711283Z 0 [Note] /Applications/MAMP/Library/bin/mysqld: Shutdown complete
2018-12-15T09:58:05.6NZ mysqld_safe mysqld from pid file /Applications/MAMP/tmp/mysql/mysql.pid ended
sudo killall -9 mysqld
Run the code in terminal and restart MAMP server.

mysql 5.7.18 failed to start on Windows 10

I did look up the web for a solution such as this very relevant post on SO, to no avail.
Here is the steps that I installed mysql for win 10 and attempts to start it:
downloaded mysql 5.7.18 zip file and unzip it into my app folder;
open "cmd" as admin and run "mysqld --install", it shows "Service successfully installed."
run "net start mysql", it shows:
The MySQL service is starting.
The MySQL service could not be started.
The service did not report an error.
More help is available by typing NET HELPMSG 3534.
Run "mysqld.exe --console", it chunked out lines of messages like below:
2017-07-16T14:55:49.066437Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-07-16T14:55:49.077216Z 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled
2017-07-16T14:55:49.081191Z 0 [Note] mysqld.exe (mysqld 5.7.18) starting as process 15872 ...
2017-07-16T14:55:50.167310Z 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2017-07-16T14:55:50.167310Z 0 [Note] InnoDB: Uses event mutexes
2017-07-16T14:55:50.168434Z 0 [Note] InnoDB: _mm_lfence() and _mm_sfence() are used for memory barrier
2017-07-16T14:55:50.169398Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2017-07-16T14:55:50.195084Z 0 [Note] InnoDB: Number of pools: 1
2017-07-16T14:55:50.249204Z 0 [Note] InnoDB: Not using CPU crc32 instructions
2017-07-16T14:55:50.290217Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2017-07-16T14:55:50.296068Z 0 [Note] InnoDB: Completed initialization of buffer pool
2017-07-16T14:55:50.453825Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2017-07-16T14:55:50.813667Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2017-07-16T14:55:50.815630Z 0 [Note] InnoDB: Setting file '.\ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2017-07-16T14:55:51.040444Z 0 [Note] InnoDB: File '.\ibtmp1' size is now 12 MB.
2017-07-16T14:55:51.062121Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2017-07-16T14:55:51.062590Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2017-07-16T14:55:51.068603Z 0 [Note] InnoDB: Waiting for purge to start
2017-07-16T14:55:51.128491Z 0 [Note] InnoDB: 5.7.18 started; log sequence number 1210018
2017-07-16T14:55:51.132269Z 0 [Note] InnoDB: Loading buffer pool(s) from C:\Users\jonat\opt\mysql-5.7.18-winx64\data\ib_buffer_pool
2017-07-16T14:55:51.133249Z 0 [Note] Plugin 'FEDERATED' is disabled.
mysqld: Table 'mysql.plugin' doesn't exist
2017-07-16T14:55:51.165071Z 0 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
2017-07-16T14:55:51.233060Z 0 [Note] InnoDB: Buffer pool(s) load completed at 170716 10:55:51
2017-07-16T14:55:51.251567Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2017-07-16T14:55:51.267669Z 0 [Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key
2017-07-16T14:55:51.272001Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
2017-07-16T14:55:51.274922Z 0 [Note] IPv6 is available.
2017-07-16T14:55:51.278873Z 0 [Note] - '::' resolves to '::';
2017-07-16T14:55:51.281791Z 0 [Note] Server socket created on IP: '::'.
2017-07-16T14:55:51.308759Z 0 [Warning] Failed to open optimizer cost constant tables
2017-07-16T14:55:51.310583Z 0 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
2017-07-16T14:55:51.311554Z 0 [ERROR] Aborting
2017-07-16T14:55:51.312531Z 0 [Note] Binlog end
2017-07-16T14:55:51.314481Z 0 [Note] Shutting down plugin 'ngram'
2017-07-16T14:55:51.314481Z 0 [Note] Shutting down plugin 'partition'
2017-07-16T14:55:51.314481Z 0 [Note] Shutting down plugin 'BLACKHOLE'
2017-07-16T14:55:51.315463Z 0 [Note] Shutting down plugin 'ARCHIVE'
2017-07-16T14:55:51.315463Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2017-07-16T14:55:51.316444Z 0 [Note] Shutting down plugin 'MRG_MYISAM'
2017-07-16T14:55:51.319389Z 0 [Note] Shutting down plugin 'MyISAM'
....
2017-07-16T14:55:52.615409Z 0 [Note] Shutting down plugin 'binlog'
2017-07-16T14:55:52.618322Z 0 [Note] mysqld.exe: Shutdown complete
In MySQL installation root folder (suppose it is c:\mysql), create a text file, say mypass.txt and copy this line to it:
ALTER USER 'root'#'localhost' IDENTIFIED BY '<yourpassword>';
The run
mysqld --initialize
mysqld --init-file=c:/mysql/mypass.txt
And if you want to run MySQL as a Windows Service:
mysqld --install MySQLXY --defaults-file="c:/mysql/my.ini"

MySQL server erroring

I've a MySQL server which I'm writing to about every 10 minutes. It seems to work fine then when I go back to it a few hours later it has crashed.
From error.log I have
2017-01-17T13:47:35.315801Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000)
2017-01-17T13:47:35.315905Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)
2017-01-17T13:47:35.495187Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp serv$
2017-01-17T13:47:35.497022Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.16-0ubuntu0.16.04.1) starting as process 18742 ...
2017-01-17T13:47:35.505459Z 0 [Note] InnoDB: PUNCH HOLE support available
2017-01-17T13:47:35.505530Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2017-01-17T13:47:35.505541Z 0 [Note] InnoDB: Uses event mutexes
2017-01-17T13:47:35.505549Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2017-01-17T13:47:35.505558Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.8
2017-01-17T13:47:35.505566Z 0 [Note] InnoDB: Using Linux native AIO
2017-01-17T13:47:35.506116Z 0 [Note] InnoDB: Number of pools: 1
2017-01-17T13:47:35.506338Z 0 [Note] InnoDB: Using CPU crc32 instructions
2017-01-17T13:47:35.508891Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2017-01-17T13:47:35.508951Z 0 [ERROR] InnoDB: mmap(137428992 bytes) failed; errno 12
2017-01-17T13:47:35.508973Z 0 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
2017-01-17T13:47:35.508983Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2017-01-17T13:47:35.508994Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2017-01-17T13:47:35.509002Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2017-01-17T13:47:35.509011Z 0 [ERROR] Failed to initialize plugins.
2017-01-17T13:47:35.509017Z 0 [ERROR] Aborting
2017-01-17T13:47:35.509026Z 0 [Note] Binlog end
2017-01-17T13:47:35.509098Z 0 [Note] Shutting down plugin 'CSV'
2017-01-17T13:47:35.509118Z 0 [Note] Shutting down plugin 'MyISAM'
2017-01-17T13:47:35.509507Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
This is a database I'm running from Python/Django, not that I think that should make any difference. I do not know what is going wrong but if I reboot the server it starts up and works fine. Could you help please.
I increased the size of the server and it has been working fine. I'll live with it