MySql service won´t start [ubuntu] - mysql

Today at around 6:23 UTC my Ubuntu Server 16.04 in Amazon EC2 made an automated apt update. From around this time my MySql server refuses to start.
At first he told me the apparmor config was wrong (like here: mysql wont start Ubuntu 16.04.2 x64) which i fixed.
Now when I try to start the mysql service like this:
:~$ sudo /etc/init.d/mysql start
[....] Starting mysql (via systemctl): mysql.serviceJob for mysql.service
failed because the control process exited with error code. See "systemctl
status mysql.service" and "journalctl -xe" for details.
failed!
systemctl status mysql.service :
:~$ sudo systemctl status mysql.service
● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: activating (start-post) (Result: exit-code) since Tue 2018-04-24 19:01:31 UTC; 27s ago
Process: 22818 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE)
Process: 22809 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
Main PID: 22818 (code=exited, status=1/FAILURE); : 22819 (mysql-systemd-s)
Tasks: 2
Memory: 324.0K
CPU: 287ms
CGroup: /system.slice/mysql.service
└─control
├─22819 /bin/bash /usr/share/mysql/mysql-systemd-start post
└─22903 sleep 1
Apr 24 19:01:31 ip-172-31-38-155 systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
Apr 24 19:01:31 ip-172-31-38-155 systemd[1]: Stopped MySQL Community Server.
Apr 24 19:01:31 ip-172-31-38-155 systemd[1]: Starting MySQL Community Server...
Apr 24 19:01:33 ip-172-31-38-155 systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
and the journalctl -ex looks like this:
journalctl -xe
-- The result is failed.
Apr 24 19:05:41 ip-172-31-38-155 systemd[1]: mysql.service: Unit entered failed state.
Apr 24 19:05:41 ip-172-31-38-155 systemd[1]: mysql.service: Failed with result 'exit-code'.
Apr 24 19:05:41 ip-172-31-38-155 systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
Apr 24 19:05:41 ip-172-31-38-155 systemd[1]: Stopped MySQL Community Server.
-- Subject: Unit mysql.service has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mysql.service has finished shutting down.
Apr 24 19:05:41 ip-172-31-38-155 systemd[1]: Starting MySQL Community Server...
-- Subject: Unit mysql.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mysql.service has begun starting up.
Apr 24 19:05:43 ip-172-31-38-155 systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
Apr 24 19:06:12 ip-172-31-38-155 systemd[1]: Failed to start MySQL Community Server.
-- Subject: Unit mysql.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mysql.service has failed.
--
-- The result is failed.
Apr 24 19:06:12 ip-172-31-38-155 systemd[1]: mysql.service: Unit entered failed state.
Apr 24 19:06:12 ip-172-31-38-155 systemd[1]: mysql.service: Failed with result 'exit-code'.
Apr 24 19:06:12 ip-172-31-38-155 systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
Apr 24 19:06:12 ip-172-31-38-155 systemd[1]: Stopped MySQL Community Server.
-- Subject: Unit mysql.service has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mysql.service has finished shutting down.
Apr 24 19:06:12 ip-172-31-38-155 systemd[1]: Starting MySQL Community Server...
-- Subject: Unit mysql.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mysql.service has begun starting up.
Apr 24 19:06:14 ip-172-31-38-155 systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
While the the cat /var/log/mysql/error.log | grep ERROR prints loads of these errors:
2018-04-24T19:10:22.941983Z 0 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
2018-04-24T19:10:22.942643Z 0 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
2018-04-24T19:10:22.942683Z 0 [ERROR] Aborting
The one whole cycle of the cat /var/log/error.log would look like this:
2018-04-24T19:14:01.701232Z 0 [Note] Shutting down plugin 'ngram'
2018-04-24T19:14:01.701238Z 0 [Note] Shutting down plugin 'BLACKHOLE'
2018-04-24T19:14:01.701241Z 0 [Note] Shutting down plugin 'partition'
2018-04-24T19:14:01.701243Z 0 [Note] Shutting down plugin 'ARCHIVE'
2018-04-24T19:14:01.701246Z 0 [Note] Shutting down plugin 'INNODB_SYS_VIRTUAL'
2018-04-24T19:14:01.701249Z 0 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2018-04-24T19:14:01.701251Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2018-04-24T19:14:01.701253Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2018-04-24T19:14:01.701256Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2018-04-24T19:14:01.701258Z 0 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2018-04-24T19:14:01.701260Z 0 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2018-04-24T19:14:01.701263Z 0 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2018-04-24T19:14:01.701265Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2018-04-24T19:14:01.701267Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2018-04-24T19:14:01.701270Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2018-04-24T19:14:01.701272Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2018-04-24T19:14:01.701274Z 0 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2018-04-24T19:14:01.701277Z 0 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2018-04-24T19:14:01.701279Z 0 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2018-04-24T19:14:01.701282Z 0 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2018-04-24T19:14:01.701284Z 0 [Note] Shutting down plugin 'INNODB_METRICS'
2018-04-24T19:14:01.701286Z 0 [Note] Shutting down plugin 'INNODB_TEMP_TABLE_INFO'
2018-04-24T19:14:01.701289Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2018-04-24T19:14:01.701291Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2018-04-24T19:14:01.701293Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2018-04-24T19:14:01.701296Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2018-04-24T19:14:01.701298Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2018-04-24T19:14:01.701300Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2018-04-24T19:14:01.701303Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM'
2018-04-24T19:14:01.701305Z 0 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2018-04-24T19:14:01.701307Z 0 [Note] Shutting down plugin 'INNODB_CMP'
2018-04-24T19:14:01.701310Z 0 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2018-04-24T19:14:01.701312Z 0 [Note] Shutting down plugin 'INNODB_LOCKS'
2018-04-24T19:14:01.701314Z 0 [Note] Shutting down plugin 'INNODB_TRX'
2018-04-24T19:14:01.701317Z 0 [Note] Shutting down plugin 'InnoDB'
2018-04-24T19:14:01.701363Z 0 [Note] InnoDB: FTS optimize thread exiting.
2018-04-24T19:14:01.701444Z 0 [Note] InnoDB: Starting shutdown...
2018-04-24T19:14:01.701486Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2018-04-24T19:14:01.701522Z 0 [Note] InnoDB: Buffer pool(s) load completed at 180424 19:14:01 (/var/lib/mysql/ib_buffer_pool was empty)
2018-04-24T19:14:01.701533Z 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
2018-04-24T19:14:01.701632Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 180424 19:14:01
2018-04-24T19:14:03.309269Z 0 [Note] InnoDB: Shutdown completed; log sequence number 8715994
2018-04-24T19:14:03.310751Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2018-04-24T19:14:03.310767Z 0 [Note] Shutting down plugin 'MyISAM'
2018-04-24T19:14:03.310781Z 0 [Note] Shutting down plugin 'CSV'
2018-04-24T19:14:03.310794Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2018-04-24T19:14:03.310840Z 0 [Note] Shutting down plugin 'MRG_MYISAM'
2018-04-24T19:14:03.310844Z 0 [Note] Shutting down plugin 'MEMORY'
2018-04-24T19:14:03.310848Z 0 [Note] Shutting down plugin 'sha256_password'
2018-04-24T19:14:03.310850Z 0 [Note] Shutting down plugin 'mysql_native_password'
2018-04-24T19:14:03.310975Z 0 [Note] Shutting down plugin 'binlog'
2018-04-24T19:14:03.311078Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
2018-04-24T19:14:32.669339Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000)
2018-04-24T19:14:32.669378Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)
2018-04-24T19:14:32.820589Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-04-24T19:14:32.822172Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.22-0ubuntu0.16.04.1) starting as process 25440 ...
2018-04-24T19:14:32.826095Z 0 [Note] InnoDB: PUNCH HOLE support available
2018-04-24T19:14:32.826121Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-04-24T19:14:32.826125Z 0 [Note] InnoDB: Uses event mutexes
2018-04-24T19:14:32.826129Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2018-04-24T19:14:32.826133Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.8
2018-04-24T19:14:32.826136Z 0 [Note] InnoDB: Using Linux native AIO
2018-04-24T19:14:32.826367Z 0 [Note] InnoDB: Number of pools: 1
2018-04-24T19:14:32.826496Z 0 [Note] InnoDB: Using CPU crc32 instructions
2018-04-24T19:14:32.827971Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2018-04-24T19:14:32.835607Z 0 [Note] InnoDB: Completed initialization of buffer pool
2018-04-24T19:14:32.837529Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2018-04-24T19:14:32.849179Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2018-04-24T19:14:32.858128Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2018-04-24T19:14:32.858180Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2018-04-24T19:14:32.892813Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2018-04-24T19:14:32.893685Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2018-04-24T19:14:32.893696Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2018-04-24T19:14:32.893952Z 0 [Note] InnoDB: Waiting for purge to start
2018-04-24T19:14:32.944316Z 0 [Note] InnoDB: 5.7.22 started; log sequence number 8715994
2018-04-24T19:14:32.944678Z 0 [Note] Plugin 'FEDERATED' is disabled.
mysqld: Table 'mysql.plugin' doesn't exist
2018-04-24T19:14:32.944791Z 0 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
2018-04-24T19:14:32.945139Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2018-04-24T19:14:32.945192Z 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-04-24T19:14:32.945201Z 0 [Note] Server hostname (bind-address): '127.0.0.1'; port: 3306
2018-04-24T19:14:32.945209Z 0 [Note] - '127.0.0.1' resolves to '127.0.0.1';
2018-04-24T19:14:32.945237Z 0 [Note] Server socket created on IP: '127.0.0.1'.
2018-04-24T19:14:32.945363Z 0 [Warning] Failed to open optimizer cost constant tables
2018-04-24T19:14:32.945455Z 0 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
2018-04-24T19:14:32.945497Z 0 [ERROR] Aborting
2018-04-24T19:14:32.945522Z 0 [Note] Binlog end
On the one hand I have seen that the the error.log tells me to run run mysql_upgrade which i cannot do because the database itself is not running.
The [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist should be fixed by an initilize command onto the service which wont work either because the service itself is not running.
I do not have a single clue what to do next. My personal best Idea for now would be to reinstall the MySql server and copy beforehand the /var/lib/mysql/mysql and the /etc/mysql directories to insert them later as a backup.
I hope anyone of you has heard something about the problem or has any kind of idea what to do. Preferably while keeping my Data.
I hope, I provided all information you need. If you need any more, just ask.
Thanks a lot in advance!

Related

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

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,

Cannot restart mysql after restarting servers

MySql was operating normally and system had some problems,but start mysql with error after restarting servers.System version:CentOS Linux release 7.7.1908
How to resolve this?
this is log
[flink#master sbin]$ ./mysqld
2020-07-22 15:42:13 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2020-07-22 15:42:13 0 [Note] ./mysqld (mysqld 5.6.45) starting as process 6401 ...
2020-07-22 15:42:13 6401 [Warning] Buffered warning: Changed limits: max_open_files: 1024 (requested 5010)
2020-07-22 15:42:13 6401 [Warning] Buffered warning: Changed limits: max_connections: 214 (requested 1000)
2020-07-22 15:42:13 6401 [Warning] Buffered warning: Changed limits: table_open_cache: 400 (requested 2000)
2020-07-22 15:42:13 6401 [Note] Plugin 'FEDERATED' is disabled.
./mysqld: Can't find file: './mysql/plugin.frm' (errno: 13 - Permission denied)
2020-07-22 15:42:13 6401 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
2020-07-22 15:42:13 6401 [Note] InnoDB: Using atomics to ref count buffer pool pages
2020-07-22 15:42:13 6401 [Note] InnoDB: The InnoDB memory heap is disabled
2020-07-22 15:42:13 6401 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2020-07-22 15:42:13 6401 [Note] InnoDB: Memory barrier is not used
2020-07-22 15:42:13 6401 [Note] InnoDB: Compressed tables use zlib 1.2.11
2020-07-22 15:42:13 6401 [Note] InnoDB: Using Linux native AIO
2020-07-22 15:42:13 6401 [Note] InnoDB: Using CPU crc32 instructions
2020-07-22 15:42:13 6401 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2020-07-22 15:42:13 6401 [Note] InnoDB: Completed initialization of buffer pool
2020-07-22 15:42:13 6401 [Note] InnoDB: Highest supported file format is Barracuda.
2020-07-22 15:42:13 6401 [Note] InnoDB: 128 rollback segment(s) are active.
2020-07-22 15:42:13 6401 [Note] InnoDB: Waiting for purge to start
2020-07-22 15:42:13 6401 [Note] InnoDB: 5.6.45 started; log sequence number 1600627
2020-07-22 15:42:13 6401 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: db5e3d0e-cbee-11ea-9
this is sql status after starting mysql
[flink#master mysql]$ systemctl status mysqld
● mysqld.service - MySQL Community Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: activating (start-post) (Result: exit-code) since Wed 2020-07-22 15:49:34 CST; 1min 5s ago
Process: 8318 ExecStart=/usr/bin/mysqld_safe --basedir=/usr (code=exited, status=1/FAILURE)
Process: 8303 ExecStartPre=/usr/bin/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
Main PID: 8318 (code=exited, status=1/FAILURE); : 8319 (mysql-systemd-s)
Tasks: 2
Memory: 17.7M
CGroup: /system.slice/mysqld.service
└─control
├─8319 /bin/bash /usr/bin/mysql-systemd-start post
└─8817 sleep 1
Jul 22 15:49:34 master systemd[1]: Starting MySQL Community Server...
Jul 22 15:49:35 master mysqld_safe[8318]: 200722 15:49:35 mysqld_safe Logging to '/var/lib/mysql/mysqld.log'.
Jul 22 15:49:35 master mysqld_safe[8318]: /usr/bin/mysqld_safe: line 138: /var/lib/mysql/mysqld.log: Permission denied
Jul 22 15:49:35 master mysqld_safe[8318]: 200722 15:49:35 mysqld_safe Directory '/home/flink/hdd/mysql_data/mysql' for UNIX socket file... exists.
Jul 22 15:49:35 master systemd[1]: mysqld.service: main process exited, code=exited, status=1/FAILURE
Hint: Some lines were ellipsized, use -l to show in full.

MariaDB: Shutdown right after start

So when i try to start mariadb this happens:
Job for mariadb.service failed because a timeout was exceeded.
See "systemctl status mariadb.service" and "journalctl -xe" for details.
systemctl status mariadb.service shows this:
* mariadb.service - MariaDB database server
Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
Active: failed (Result: timeout) since Mon 2019-02-18 10:11:09 UTC; 4min 1s ago
Process: 779 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Process: 692 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ]
Process: 690 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Process: 689 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
Main PID: 779 (code=exited, status=0/SUCCESS)
Feb 18 10:09:36 vps-zap348646-1 systemd[1]: Starting MariaDB database server...
Feb 18 10:09:37 vps-zap348646-1 mysqld[779]: 2019-02-18 10:09:37 140439143227328 [Note] /usr/sbin/mysqld (mysqld 10.1.29-MariaDB-6ubuntu2) starting as process
Feb 18 10:11:07 vps-zap348646-1 systemd[1]: mariadb.service: Start operation timed out. Terminating.
Feb 18 10:11:09 vps-zap348646-1 systemd[1]: mariadb.service: Failed with result 'timeout'.
Feb 18 10:11:09 vps-zap348646-1 systemd[1]: Failed to start MariaDB database server.
journalctl -xe shows this:
Feb 18 10:17:09 vps-zap348646-1 systemd[1]: Starting MariaDB database server...
-- Subject: Unit mariadb.service has begun start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit mariadb.service has begun starting up.
Feb 18 10:17:10 vps-zap348646-1 mysqld[940]: 2019-02-18 10:17:10 139827003494336 [Note] /usr/sbin/mysqld (mysqld 10.1.29-MariaDB-6ubuntu2)
Feb 18 10:18:39 vps-zap348646-1 systemd[1]: mariadb.service: Start operation timed out. Terminating.
Feb 18 10:18:41 vps-zap348646-1 systemd[1]: mariadb.service: Failed with result 'timeout'.
Feb 18 10:18:41 vps-zap348646-1 systemd[1]: Failed to start MariaDB database server.
-- Subject: Unit mariadb.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit mariadb.service has failed.
--
-- The result is RESULT.
And finally error.log in mysql:
2019-02-18 10:17:10 139827003494336 [Note] InnoDB: Using mutexes to ref count buffer pool pages
2019-02-18 10:17:10 139827003494336 [Note] InnoDB: The InnoDB memory heap is disabled
2019-02-18 10:17:10 139827003494336 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2019-02-18 10:17:10 139827003494336 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2019-02-18 10:17:10 139827003494336 [Note] InnoDB: Compressed tables use zlib 1.2.11
2019-02-18 10:17:10 139827003494336 [Note] InnoDB: Using Linux native AIO
2019-02-18 10:17:10 139827003494336 [Note] InnoDB: Using SSE crc32 instructions
2019-02-18 10:17:10 139827003494336 [Note] InnoDB: Initializing buffer pool, size = 1.0G
2019-02-18 10:17:10 139827003494336 [Note] InnoDB: Completed initialization of buffer pool
2019-02-18 10:17:10 139827003494336 [Note] InnoDB: Highest supported file format is Barracuda.
2019-02-18 10:17:10 139827003494336 [Note] InnoDB: 128 rollback segment(s) are active.
2019-02-18 10:17:10 139827003494336 [Note] InnoDB: Waiting for purge to start
2019-02-18 10:17:10 139827003494336 [Note] InnoDB: Percona XtraDB (http://www.percona.com) 5.6.36-82.2 started; log sequence number 103241 029
2019-02-18 10:17:10 139827003494336 [Note] Plugin 'FEEDBACK' is disabled.
2019-02-18 10:17:10 139825235617536 [Note] InnoDB: Dumping buffer pool(s) not yet started
2019-02-18 10:17:10 139827003494336 [Note] Server socket created on IP: '127.0.0.1'.
2019-02-18 10:17:10 139827003494336 [Note] /usr/sbin/mysqld: ready for connections.
Version: '10.1.29-MariaDB-6ubuntu2' socket: '/var/run/mysqld/mysqld.sock' port: 3306 Ubuntu 18.10
2019-02-18 10:18:39 139827002763008 [Note] /usr/sbin/mysqld: Normal shutdown
2019-02-18 10:18:39 139827002763008 [Note] Event Scheduler: Purging the queue. 0 events
2019-02-18 10:18:39 139825283266304 [Note] InnoDB: FTS optimize thread exiting.
2019-02-18 10:18:39 139827002763008 [Note] InnoDB: Starting shutdown...
2019-02-18 10:18:39 139827002763008 [Note] InnoDB: Waiting for page_cleaner to finish flushing of buffer pool
2019-02-18 10:18:41 139827002763008 [Note] InnoDB: Shutdown completed; log sequence number 103241039
2019-02-18 10:18:41 139827002763008 [Note] /usr/sbin/mysqld: Shutdown complete
Either I am blind or there just isn't any error and mariadb is just not working.
Maybe one of you guys have an idea. Thanks.
Edit:
I found a "solution" for now, mariadb is shutting down because of a timeout when starting, so for now I set the timeout to 0. For now this solution is enough but there must be a real solution.
Please note that since 10.1.10, MariaDB uses systemd to start the service. The /etc/init.d/mysql script is no longer used, so MYSQLD_STARTUP_TIMEOUT has no effect.
You need to find your mariadb.service file. In our case, it did not contain a timeout so the MariaDB default was being used. Just add /etc/systemd/system/mariadb.service.d/override.conf file, and put in it:
[Service]
TimeoutStartSec = 0
In the [Service] section, and it will never time out. After create the file:
# systemctl daemon-reload
# systemctl restart mysql.service

MySQL Server shuts down frequently and won't start again now

OS: Ubuntu 16.04.1 LTS xenial
I installed MySQL on my server on AWS and it was working fine, but after we started getting much traffic on-site, it started failing frequently. To fix it, I usually restart the service or server which works but for only a few minutes/hours and then it fails again. Now MySQL doesn't start again even after I restart the server.
Running sudo systemctl start mysql i get this message
Job for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" and "journalctl -xe" for details.
And this is the content logged in /var/log/mysql/error.log
2017-02-08T11:35:32.352942Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000)
2017-02-08T11:35:32.352975Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)
2017-02-08T11:35:32.509812Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-02-08T11:35:32.510752Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.17-0ubuntu0.16.04.1) starting as process 3060 ...
2017-02-08T11:35:32.514030Z 0 [Note] InnoDB: PUNCH HOLE support available
2017-02-08T11:35:32.514046Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2017-02-08T11:35:32.514049Z 0 [Note] InnoDB: Uses event mutexes
2017-02-08T11:35:32.514054Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2017-02-08T11:35:32.514057Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.8
2017-02-08T11:35:32.514060Z 0 [Note] InnoDB: Using Linux native AIO
2017-02-08T11:35:32.514265Z 0 [Note] InnoDB: Number of pools: 1
2017-02-08T11:35:32.514359Z 0 [Note] InnoDB: Using CPU crc32 instructions
2017-02-08T11:35:32.515647Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2017-02-08T11:35:32.522465Z 0 [Note] InnoDB: Completed initialization of buffer pool
2017-02-08T11:35:32.524160Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2017-02-08T11:35:32.535815Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2017-02-08T11:35:32.536689Z 0 [Note] InnoDB: Log scan progressed past the checkpoint lsn 30903245
2017-02-08T11:35:32.536703Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 30904484
2017-02-08T11:35:32.536738Z 0 [ERROR] InnoDB: Ignoring the redo log due to missing MLOG_CHECKPOINT between the checkpoint 30903245 and the end 30904484.
2017-02-08T11:35:32.536747Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2017-02-08T11:35:33.137801Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2017-02-08T11:35:33.137835Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2017-02-08T11:35:33.137841Z 0 [ERROR] Failed to initialize plugins.
2017-02-08T11:35:33.137843Z 0 [ERROR] Aborting
2017-02-08T11:35:33.137848Z 0 [Note] Binlog end
2017-02-08T11:35:33.137893Z 0 [Note] Shutting down plugin 'MyISAM'
2017-02-08T11:35:33.137914Z 0 [Note] Shutting down plugin 'CSV'
2017-02-08T11:35:33.138111Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
Still don't know what went wrong but deleting the files /var/lib/mysql/ib_logfile* solved it.
please try the following
/etc/init.d/mysql stop
service mysql stop
sudo killall -KILL mysql mysqld_safe mysqld
/etc/init.d/mysql start
systemctl status mysql
And it should show active status for the mysql server

Docker: Mysql crashes after few seconds when it has been started

I am on Mac 10.11.3 (15D21)
About Docker I have:
$ docker version
Client:
Version: 1.10.3
API version: 1.22
Go version: go1.5.3
Git commit: 20f81dd
Built: Thu Mar 10 21:49:11 2016
OS/Arch: darwin/amd64
Server:
Version: 1.10.3
API version: 1.22
Go version: go1.5.3
Git commit: 20f81dd
Built: Thu Mar 10 21:49:11 2016
OS/Arch: linux/amd64
With the following Dockerfile (it to resolve Docker with mysql: The error means mysqld does not have the access rights to the directory):
FROM mysql:latest
RUN deluser mysql
RUN useradd mysql
RUN mkdir -p /Users/me/docker/mysql/data
RUN chmod -R 777 /Users/me/docker/mysql/data
I have created a new image docker build -t localmysql:latest . named localmysql
REPOSITORY TAG IMAGE ID CREATED SIZE
localmysql latest ea0f7da32de8 15 hours ago 361.6 MB
I can create the manolitomysql new container from the localmysql new image (I am using multiple lines for better appreciation):
docker run -v /Users/me/docker/mysql/data:/var/lib/mysql
--name manolitomysql
-e MYSQL_DATABASE='mysqldb' -e MYSQL_USER='mysql'
-e MYSQL_PASSWORD='mysql' -e MYSQL_ALLOW_EMPTY_PASSWORD='yes'
-e MYSQL_ROOT_PASSWORD='' -d localmysql
The container runs:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
06f15352aa7c localmysql "/entrypoint.sh mysql" 23 seconds ago Up 22 seconds 3306/tcp manolitomysql
Even I can enter to the console with docker exec -it manolitomysql /bin/bash
But after of more of 30 seconds the container crushes
#docker logs manolitomysql
Initializing database
2016-03-28T13:27:01.600230Z 0 [Warning] Setting lower_case_table_names=2 because file system for /var/lib/mysql/ is case insensitive
2016-03-28T13:27:03.355428Z 0 [Warning] InnoDB: New log files created, LSN=45790
2016-03-28T13:27:03.705206Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2016-03-28T13:27:03.765510Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: c2837bb5-f4e8-11e5-a856-0242ac110002.
2016-03-28T13:27:03.766641Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2016-03-28T13:27:03.767732Z 1 [Warning] root#localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
2016-03-28T13:27:04.960541Z 1 [Warning] 'user' entry 'root#localhost' ignored in --skip-name-resolve mode.
2016-03-28T13:27:04.960616Z 1 [Warning] 'user' entry 'mysql.sys#localhost' ignored in --skip-name-resolve mode.
2016-03-28T13:27:04.960716Z 1 [Warning] 'db' entry 'sys mysql.sys#localhost' ignored in --skip-name-resolve mode.
2016-03-28T13:27:04.960846Z 1 [Warning] 'proxies_priv' entry '# root#localhost' ignored in --skip-name-resolve mode.
2016-03-28T13:27:04.960962Z 1 [Warning] 'tables_priv' entry 'sys_config mysql.sys#localhost' ignored in --skip-name-resolve mode.
Database initialized
MySQL init process in progress...
2016-03-28T13:27:07.059842Z 0 [Note] mysqld (mysqld 5.7.11) starting as process 38 ...
2016-03-28T13:27:07.062158Z 0 [Warning] Setting lower_case_table_names=2 because file system for /var/lib/mysql/ is case insensitive
2016-03-28T13:27:07.063330Z 0 [ERROR] Plugin keyring_file reported: 'keyring_file initialization failure. Please check if the keyring_file_data points to readable keyring file or keyring file can be created in the specified location. The keyring_file will stay unusable until correct path to the keyring file gets provided'
2016-03-28T13:27:07.063747Z 0 [Note] InnoDB: PUNCH HOLE support available
2016-03-28T13:27:07.063766Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-03-28T13:27:07.063776Z 0 [Note] InnoDB: Uses event mutexes
2016-03-28T13:27:07.063785Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2016-03-28T13:27:07.063794Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.8
2016-03-28T13:27:07.063803Z 0 [Note] InnoDB: Using Linux native AIO
2016-03-28T13:27:07.063957Z 0 [Note] InnoDB: Number of pools: 1
2016-03-28T13:27:07.064037Z 0 [Note] InnoDB: Using CPU crc32 instructions
2016-03-28T13:27:07.069596Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2016-03-28T13:27:07.075441Z 0 [Note] InnoDB: Completed initialization of buffer pool
2016-03-28T13:27:07.076643Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2016-03-28T13:27:07.102198Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2016-03-28T13:27:07.133326Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2016-03-28T13:27:07.133809Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2016-03-28T13:27:07.185431Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2016-03-28T13:27:07.263862Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2016-03-28T13:27:07.263953Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2016-03-28T13:27:07.264530Z 0 [Note] InnoDB: Waiting for purge to start
2016-03-28T13:27:07.315152Z 0 [Note] InnoDB: 5.7.11 started; log sequence number 2492554
2016-03-28T13:27:07.315489Z 0 [Note] Plugin 'FEDERATED' is disabled.
2016-03-28T13:27:07.316620Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2016-03-28T13:27:07.326420Z 0 [Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key
2016-03-28T13:27:07.326507Z 0 [ERROR] Could not create unix socket lock file /var/run/mysqld/mysqld.sock.lock.
2016-03-28T13:27:07.326522Z 0 [ERROR] Unable to setup unix socket lock file.
2016-03-28T13:27:07.326531Z 0 [ERROR] Aborting
2016-03-28T13:27:07.326545Z 0 [Note] Binlog end
2016-03-28T13:27:07.326591Z 0 [Note] Shutting down plugin 'ngram'
2016-03-28T13:27:07.326605Z 0 [Note] Shutting down plugin 'BLACKHOLE'
2016-03-28T13:27:07.326614Z 0 [Note] Shutting down plugin 'partition'
2016-03-28T13:27:07.326623Z 0 [Note] Shutting down plugin 'ARCHIVE'
2016-03-28T13:27:07.326632Z 0 [Note] Shutting down plugin 'MEMORY'
2016-03-28T13:27:07.326641Z 0 [Note] Shutting down plugin 'INNODB_SYS_VIRTUAL'
2016-03-28T13:27:07.326650Z 0 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2016-03-28T13:27:07.326658Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2016-03-28T13:27:07.326673Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2016-03-28T13:27:07.326681Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2016-03-28T13:27:07.326690Z 0 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2016-03-28T13:27:07.326698Z 0 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2016-03-28T13:27:07.326706Z 0 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2016-03-28T13:27:07.326715Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2016-03-28T13:27:07.326723Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2016-03-28T13:27:07.326731Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2016-03-28T13:27:07.326740Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2016-03-28T13:27:07.326748Z 0 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2016-03-28T13:27:07.326757Z 0 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2016-03-28T13:27:07.326765Z 0 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2016-03-28T13:27:07.326773Z 0 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2016-03-28T13:27:07.326782Z 0 [Note] Shutting down plugin 'INNODB_METRICS'
2016-03-28T13:27:07.326790Z 0 [Note] Shutting down plugin 'INNODB_TEMP_TABLE_INFO'
2016-03-28T13:27:07.326798Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2016-03-28T13:27:07.326807Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2016-03-28T13:27:07.326816Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2016-03-28T13:27:07.326824Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2016-03-28T13:27:07.326832Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2016-03-28T13:27:07.326841Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2016-03-28T13:27:07.326850Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM'
2016-03-28T13:27:07.326858Z 0 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2016-03-28T13:27:07.326866Z 0 [Note] Shutting down plugin 'INNODB_CMP'
2016-03-28T13:27:07.326875Z 0 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2016-03-28T13:27:07.326883Z 0 [Note] Shutting down plugin 'INNODB_LOCKS'
2016-03-28T13:27:07.326894Z 0 [Note] Shutting down plugin 'INNODB_TRX'
2016-03-28T13:27:07.326903Z 0 [Note] Shutting down plugin 'InnoDB'
2016-03-28T13:27:07.326970Z 0 [Note] InnoDB: FTS optimize thread exiting.
2016-03-28T13:27:07.327081Z 0 [Note] InnoDB: Starting shutdown...
2016-03-28T13:27:07.327112Z 0 [Note] InnoDB: Buffer pool(s) load completed at 160328 13:27:07
2016-03-28T13:27:07.327946Z 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
2016-03-28T13:27:07.328953Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 160328 13:27:07
MySQL init process in progress...
MySQL init process in progress...
2016-03-28T13:27:08.954395Z 0 [Note] InnoDB: Shutdown completed; log sequence number 2492573
2016-03-28T13:27:08.956113Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2016-03-28T13:27:08.956170Z 0 [Note] Shutting down plugin 'MyISAM'
2016-03-28T13:27:08.956206Z 0 [Note] Shutting down plugin 'MRG_MYISAM'
2016-03-28T13:27:08.956221Z 0 [Note] Shutting down plugin 'CSV'
2016-03-28T13:27:08.956234Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2016-03-28T13:27:08.956293Z 0 [Note] Shutting down plugin 'sha256_password'
2016-03-28T13:27:08.956306Z 0 [Note] Shutting down plugin 'mysql_native_password'
2016-03-28T13:27:08.956317Z 0 [Note] Shutting down plugin 'keyring_file'
2016-03-28T13:27:08.956515Z 0 [Note] Shutting down plugin 'binlog'
2016-03-28T13:27:08.956853Z 0 [Note] mysqld: Shutdown complete
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process failed.
Manuels-MacBook-Pro:~ manueljordan$
Below the errors from above:
One
[ERROR] Plugin keyring_file reported: 'keyring_file initialization failure. Please check if the keyring_file_data points to readable keyring file or keyring file can be created in the specified location. The keyring_file will stay unusable until correct path to the keyring file gets provided'
Second
[ERROR] Could not create unix socket lock file /var/run/mysqld/mysqld.sock.lock.
[ERROR] Unable to setup unix socket lock file.
[ERROR] Aborting
What extra configuration is needed?
I'm guessing that you've got permissions issues, and that /var/run/mysqld is owned by the UID/GID of the mysql user created by the MySQL install process in the original Docker image. Try this in your Dockerfile:
FROM mysql:latest
RUN deluser mysql
RUN useradd mysql
RUN chown mysql:mysql /var/run/mysqld
RUN mkdir -p /Users/me/docker/mysql/data
RUN chmod -R 777 /Users/me/docker/mysql/data
Further guessing that the case is the same for the 'keyring_file', wherever that's located. Try running a docker run -it manolitomysql /bin/bash to get a shell prompt into your container, and see if you can draw a bead on it.
2016-03-28T13:27:07.326420Z 0 [Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key
2016-03-28T13:27:07.326507Z 0 [ERROR] Could not create unix socket lock file /var/run/mysqld/mysqld.sock.lock.
2016-03-28T13:27:07.326522Z 0 [ERROR] Unable to setup unix socket lock file.
maybe you need to configure SSL certificates?