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

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?

Related

InnoDB: Header page consists of zero bytes in datafile: ./ibdata1

I am deploying MySQL on openshift (kubernetes) but getting below error
---> 10:01:34 Initializing database ...
---> 10:01:34 Running /opt/rh/rh-mysql57/root/usr/libexec/mysqld --initialize --datadir=/var/lib/mysql/data --ignore-db-dir=lost+found
---> 10:01:35 Starting MySQL server with disabled networking ...
---> 10:01:35 Waiting for MySQL to start ...
2019-10-18T10:01:35.188509Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2019-10-18T10:01:35.188567Z 0 [Warning] 'NO_AUTO_CREATE_USER' sql mode was not set.
2019-10-18T10:01:35.325995Z 0 [Note] /opt/rh/rh-mysql57/root/usr/libexec/mysqld (mysqld 5.7.24) starting as process 40 ...
2019-10-18T10:01:35.430574Z 0 [Note] InnoDB: PUNCH HOLE support available
2019-10-18T10:01:35.430612Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2019-10-18T10:01:35.430621Z 0 [Note] InnoDB: Uses event mutexes
2019-10-18T10:01:35.430627Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2019-10-18T10:01:35.430634Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.7
2019-10-18T10:01:35.430642Z 0 [Note] InnoDB: Using Linux native AIO
2019-10-18T10:01:35.431024Z 0 [Note] InnoDB: Number of pools: 1
2019-10-18T10:01:35.431174Z 0 [Note] InnoDB: Using CPU crc32 instructions
2019-10-18T10:01:35.433296Z 0 [Note] InnoDB: Initializing buffer pool, total size = 2G, instances = 8, chunk size = 128M
2019-10-18T10:01:35.584269Z 0 [Note] InnoDB: Completed initialization of buffer pool
2019-10-18T10:01:35.610249Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2019-10-18T10:01:35.624480Z 0 [ERROR] InnoDB: Header page consists of zero bytes in datafile: ./ibdata1, Space ID:0, Flags: 0. Please refer to http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting-datadict.html for how to resolve the issue.
2019-10-18T10:01:35.624518Z 0 [ERROR] InnoDB: Corrupted page [page id: space=0, page number=0] of datafile './ibdata1' could not be found in the doublewrite buffer.
2019-10-18T10:01:35.624667Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Data structure corruption
---> 10:01:36 Waiting for MySQL to start ...
2019-10-18T10:01:36.225356Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2019-10-18T10:01:36.225372Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2019-10-18T10:01:36.225377Z 0 [ERROR] Failed to initialize builtin plugins.
2019-10-18T10:01:36.225380Z 0 [ERROR] Aborting
2019-10-18T10:01:36.225393Z 0 [Note] Binlog end
2019-10-18T10:01:36.225454Z 0 [Note] Shutting down plugin 'CSV'
2019-10-18T10:01:36.233760Z 0 [Note] /opt/rh/rh-mysql57/root/usr/libexec/mysqld: Shutdown complete
I searched on google and they recommend to do following
rm -rf /var/lib/mysql/ib_logfile*
but as you know in docker and kubernetes world as soon as pod is not able to come up we cant login to pod and delete these files. Due to this error MySQL pod is not coming up.
I am using glusterfs and i deleted PVC and recreated but still same error.
Update1:
After recommendation of #Crou i did following changes
I downloaded new "centos/mysql-57-centos7:5.7" image and retry still same issue
I used mysql:5.7 image and now its throwing following error
I deleted PVC and recreated with different size but still same error.
[ERROR] --initialize specified but the data directory has files in it. Aborting.
[ERROR] Aborting
It seems to me that your image is broken, or at least the data you are trying to load.
Even if you do remove the files /var/lib/mysql/ib_logfile* this will break again when pod will be rescheduled.
You can try getting into the pod using kubectl exec -it <pod_name> bash when it is still starting and quickly do the changes. If it's already too late and it just fails within few seconds with crashloopbackoff, you might try fixing this in the dockerfile that is being used to crate the image. If you have no access to the dockerfile, you can create your own dockerfile and build image based on it.
Here is a documentation with Dockerfile reference that might be helpful.
Dockerfile include something like this:
FROM oraclelinux:7-slim
RUN rm -rf /var/lib/mysql/ib_logfile*
EXPOSE 3306 6606 6446 6447 33060
CMD [""]
Please keep in mind this is just a short example and might not work on it self.
I was able to find this github mattlord/Docker-InnoDB-Cluster, maybe it will be of help.
After different retries i am able to solve issues, Following are findings
I observed that when first time i recreate PVC and deploy mysql it take too much time at this line
Running /opt/rh/rh-mysql57/root/usr/libexec/mysqld --initialize --datadir=/var/lib/mysql/data --ignore-db-dir=lost+found
During this time LiveProbe time exaust and it restart the container, which result in subjected error.
I increased the time of initialDelaySeconds under livenessProbe to 240, this time it started mysql after 4 mins
After 4 minutes it shows Starting MySQL server with disabled networking and start doing further.
My applications are able to connect it but i dont know what would be the impact of this?
---> 16:18:24 Running /opt/rh/rh-mysql57/root/usr/libexec/mysqld --initialize --datadir=/var/lib/mysql/data --ignore-db-dir=lost+found
---> 16:22:15 Starting MySQL server with disabled networking ...
---> 16:22:15 Waiting for MySQL to start ...
2019-10-18T16:22:15.752499Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2019-10-18T16:22:15.772646Z 0 [Note] /opt/rh/rh-mysql57/root/usr/libexec/mysqld (mysqld 5.7.24) starting as process 69 ...
2019-10-18T16:22:15.849580Z 0 [Note] InnoDB: PUNCH HOLE support available
2019-10-18T16:22:15.849613Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2019-10-18T16:22:15.849617Z 0 [Note] InnoDB: Uses event mutexes
2019-10-18T16:22:15.849621Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2019-10-18T16:22:15.849624Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.7
2019-10-18T16:22:15.849629Z 0 [Note] InnoDB: Using Linux native AIO
2019-10-18T16:22:15.850236Z 0 [Note] InnoDB: Number of pools: 1
2019-10-18T16:22:15.850459Z 0 [Note] InnoDB: Using CPU crc32 instructions
2019-10-18T16:22:15.852211Z 0 [Note] InnoDB: Initializing buffer pool, total size = 2G, instances = 8, chunk size = 128M
2019-10-18T16:22:15.978704Z 0 [Note] InnoDB: Completed initialization of buffer pool
2019-10-18T16:22:16.005183Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2019-10-18T16:22:16.208237Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2019-10-18T16:22:16.402086Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2019-10-18T16:22:16.414708Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
---> 16:22:17 Waiting for MySQL to start ...
---> 16:22:18 Waiting for MySQL to start ...
2019-10-18T16:22:18.601639Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2019-10-18T16:22:18.608922Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2019-10-18T16:22:18.608943Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2019-10-18T16:22:18.609240Z 0 [Note] InnoDB: Waiting for purge to start
2019-10-18T16:22:18.659387Z 0 [Note] InnoDB: 5.7.24 started; log sequence number 2592555
2019-10-18T16:22:18.659667Z 0 [Note] Plugin 'FEDERATED' is disabled.
2019-10-18T16:22:18.663687Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/data/ib_buffer_pool
2019-10-18T16:22:18.808093Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
2019-10-18T16:22:18.808117Z 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory.
2019-10-18T16:22:18.825225Z 0 [Warning] CA certificate ca.pem is self signed.
2019-10-18T16:22:18.828435Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.
2019-10-18T16:22:18.885079Z 0 [Note] InnoDB: Buffer pool(s) load completed at 191018 16:22:18
2019-10-18T16:22:18.948358Z 0 [Warning] 'user' entry 'root#localhost' ignored in --skip-name-resolve mode.
2019-10-18T16:22:18.948397Z 0 [Warning] 'user' entry 'mysql.session#localhost' ignored in --skip-name-resolve mode.
2019-10-18T16:22:18.948404Z 0 [Warning] 'user' entry 'mysql.sys#localhost' ignored in --skip-name-resolve mode.
2019-10-18T16:22:18.948428Z 0 [Warning] 'db' entry 'performance_schema mysql.session#localhost' ignored in --skip-name-resolve mode.
2019-10-18T16:22:18.948435Z 0 [Warning] 'db' entry 'sys mysql.sys#localhost' ignored in --skip-name-resolve mode.
2019-10-18T16:22:18.948448Z 0 [Warning] 'proxies_priv' entry '# root#localhost' ignored in --skip-name-resolve mode.
2019-10-18T16:22:19.034170Z 0 [Warning] 'tables_priv' entry 'user mysql.session#localhost' ignored in --skip-name-resolve mode.
2019-10-18T16:22:19.034191Z 0 [Warning] 'tables_priv' entry 'sys_config mysql.sys#localhost' ignored in --skip-name-resolve mode.
2019-10-18T16:22:19.633088Z 0 [Note] Event Scheduler: Loaded 0 events
2019-10-18T16:22:19.633217Z 1 [Note] Event Scheduler: scheduler thread started with id 1
2019-10-18T16:22:19.633316Z 0 [Note] /opt/rh/rh-mysql57/root/usr/libexec/mysqld: ready for connections.
Version: '5.7.24' socket: '/tmp/mysql.sock' port: 0 MySQL Community Server (GPL)
2019-10-18T16:22:19.634316Z 3 [Note] Your password has expired. To log in you must change it using a client that supports expired passwords.
---> 16:22:19 MySQL started successfully
---> 16:22:19 Setting password for MySQL root user ...

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

Can't start server : Bind on unix socket: Operation not permitted

environment:
docker:Docker version 17.12.0-ce, build c97c6d6
windows:windows 10
docker-images:mysql/mysql-server latest
I user this command success to create a container,but auto stop a few seconds later:
docker run -d -p 3306:3306 -e MYSQL_ROOT_PASSWORD="root" -e MYSQL_USER="sa" -e MYSQL_PASSWORD="123456" -v "/C/mysql/Config/my.cnf":/etc/my.cnf -v "/C/mysql/Data":/var/lib/mysql --name server mysql/mysql-server
docker logs server:
Starting MySQL 5.7.21-1.1.3
2018-02-11T12:53:22.120561Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-02-11T12:53:22.125276Z 0 [Note] mysqld (mysqld 5.7.21) starting as process 1 ...
2018-02-11T12:53:22.139968Z 0 [Note] InnoDB: PUNCH HOLE support available
2018-02-11T12:53:22.140147Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-02-11T12:53:22.140221Z 0 [Note] InnoDB: Uses event mutexes
2018-02-11T12:53:22.140282Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2018-02-11T12:53:22.140345Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2018-02-11T12:53:22.140404Z 0 [Note] InnoDB: Using Linux native AIO
2018-02-11T12:53:22.141479Z 0 [Note] InnoDB: Number of pools: 1
2018-02-11T12:53:22.144262Z 0 [Note] InnoDB: Using CPU crc32 instructions
2018-02-11T12:53:22.146215Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2018-02-11T12:53:22.154759Z 0 [Note] InnoDB: Completed initialization of buffer pool
2018-02-11T12:53:22.158172Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2018-02-11T12:53:22.212129Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2018-02-11T12:53:22.304744Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2018-02-11T12:53:22.304989Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2018-02-11T12:53:22.307389Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2018-02-11T12:53:22.469757Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2018-02-11T12:53:22.481187Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2018-02-11T12:53:22.481622Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2018-02-11T12:53:22.482185Z 0 [Note] InnoDB: Waiting for purge to start
2018-02-11T12:53:22.533061Z 0 [Note] InnoDB: 5.7.21 started; log sequence number 2552053
2018-02-11T12:53:22.533556Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2018-02-11T12:53:22.533812Z 0 [Note] Plugin 'FEDERATED' is disabled.
2018-02-11T12:53:22.591600Z 0 [Note] InnoDB: Buffer pool(s) load completed at 180211 12:53:22
2018-02-11T12:53:22.600231Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
2018-02-11T12:53:22.600407Z 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory.
2018-02-11T12:53:22.606883Z 0 [Warning] CA certificate ca.pem is self signed.
2018-02-11T12:53:22.608530Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.
2018-02-11T12:53:22.611190Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
2018-02-11T12:53:22.611373Z 0 [Note] IPv6 is available.
2018-02-11T12:53:22.611457Z 0 [Note] - '::' resolves to '::';
2018-02-11T12:53:22.611539Z 0 [Note] Server socket created on IP: '::'.
2018-02-11T12:53:22.620768Z 0 [ERROR] Can't start server : Bind on unix socket: Operation not permitted
2018-02-11T12:53:22.620942Z 0 [ERROR] Do you already have another mysqld server running on socket: /var/lib/mysql/mysql.sock ?
2018-02-11T12:53:22.621067Z 0 [ERROR] Aborting
2018-02-11T12:53:22.621204Z 0 [Note] Binlog end
2018-02-11T12:53:22.621421Z 0 [Note] Shutting down plugin 'ngram'
2018-02-11T12:53:22.621550Z 0 [Note] Shutting down plugin 'partition'
2018-02-11T12:53:22.621645Z 0 [Note] Shutting down plugin 'BLACKHOLE'
2018-02-11T12:53:22.621744Z 0 [Note] Shutting down plugin 'ARCHIVE'
2018-02-11T12:53:22.621832Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2018-02-11T12:53:22.621993Z 0 [Note] Shutting down plugin 'MRG_MYISAM'
2018-02-11T12:53:22.622088Z 0 [Note] Shutting down plugin 'MyISAM'
2018-02-11T12:53:22.622199Z 0 [Note] Shutting down plugin 'INNODB_SYS_VIRTUAL'
2018-02-11T12:53:22.622266Z 0 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2018-02-11T12:53:22.622314Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2018-02-11T12:53:22.622378Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2018-02-11T12:53:22.622426Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2018-02-11T12:53:22.622488Z 0 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2018-02-11T12:53:22.622536Z 0 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2018-02-11T12:53:22.622599Z 0 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2018-02-11T12:53:22.622647Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2018-02-11T12:53:22.622724Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2018-02-11T12:53:22.622773Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2018-02-11T12:53:22.622837Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2018-02-11T12:53:22.622885Z 0 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2018-02-11T12:53:22.622947Z 0 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2018-02-11T12:53:22.623031Z 0 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2018-02-11T12:53:22.623087Z 0 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2018-02-11T12:53:22.623143Z 0 [Note] Shutting down plugin 'INNODB_METRICS'
2018-02-11T12:53:22.623197Z 0 [Note] Shutting down plugin 'INNODB_TEMP_TABLE_INFO'
2018-02-11T12:53:22.623254Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2018-02-11T12:53:22.623308Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2018-02-11T12:53:22.623363Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2018-02-11T12:53:22.623418Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2018-02-11T12:53:22.623474Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2018-02-11T12:53:22.623528Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2018-02-11T12:53:22.623648Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM'
2018-02-11T12:53:22.623753Z 0 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2018-02-11T12:53:22.623845Z 0 [Note] Shutting down plugin 'INNODB_CMP'
2018-02-11T12:53:22.623953Z 0 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2018-02-11T12:53:22.624004Z 0 [Note] Shutting down plugin 'INNODB_LOCKS'
2018-02-11T12:53:22.624068Z 0 [Note] Shutting down plugin 'INNODB_TRX'
2018-02-11T12:53:22.624116Z 0 [Note] Shutting down plugin 'InnoDB'
2018-02-11T12:53:22.624273Z 0 [Note] InnoDB: FTS optimize thread exiting.
2018-02-11T12:53:22.624454Z 0 [Note] InnoDB: Starting shutdown...
2018-02-11T12:53:22.724955Z 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
2018-02-11T12:53:22.739902Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 180211 12:53:22
2018-02-11T12:53:24.348445Z 0 [Note] InnoDB: Shutdown completed; log sequence number 2552072
2018-02-11T12:53:24.352699Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2018-02-11T12:53:24.353012Z 0 [Note] Shutting down plugin 'MEMORY'
2018-02-11T12:53:24.353110Z 0 [Note] Shutting down plugin 'CSV'
2018-02-11T12:53:24.353214Z 0 [Note] Shutting down plugin 'sha256_password'
2018-02-11T12:53:24.353308Z 0 [Note] Shutting down plugin 'mysql_native_password'
2018-02-11T12:53:24.353542Z 0 [Note] Shutting down plugin 'binlog'
2018-02-11T12:53:24.357751Z 0 [Note] mysqld: Shutdown complete
I had set dir "C:/mysql/" permission for everyone,how should i do? or forgot something?
permission
docker ps -a
thanks for Ahab help,When I Add tab ":rw"
still the same result
Can't start server : Bind on unix socket: Operation not permitted
result1result2
According to https://dev.mysql.com/doc/refman/5.7/en/deploy-mysql-nonlinux-docker.html:
Quote:
If you are bind-mounting on the container's MySQL data directory (see Persisting Data and Configuration Changes for details), you have to set the location of the server socket file with the --socket option to somewhere outside of the MySQL data directory; otherwise, the server will fail to start. This is because the way Docker for Windows handles file mounting does not allow a host file from being bind-mounted on the socket file.
I had to use a docker volume to solve this issue on win 10, the compose file is given below
version: '3'
services:
webapp:
build:
context: .
dockerfile: Dockerfile-webapp
image: webapp
privileged: true
volumes:
- ./app:/var/www/html/app
- ./httpd.conf:/etc/httpd/conf/httpd.conf
ports:
- "8080:80"
environment:
- dockerenv=true
links:
- dbserver:dbserver
dbserver:
image: percona:5.6.41
restart: always
environment:
MYSQL_ROOT_PASSWORD:
ports:
- "3306:3306"
volumes:
- dockerdbdata:/var/lib/mysql
- ./query/init.sql:/docker-entrypoint-initdb.d/init.sql
privileged: true
volumes:
dockerdbdata:

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 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