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

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

Related

MAMP not working after Macbook crashes. How do I restore MAMP and my databases?

My Macbook crashed and now MAMP (latest version v6.6.3) is not working anymore.
I was able to log in to MYSQL only over command line with
/Applications/MAMP/bin/startMysql.sh
/Applications/MAMP/bin/startApache.sh
But my databases are gone.
However, I can see in the error log that there is an issue with one of my databases (drupal8). So the database is still somewhere? But why can't I see it?
2022-10-12T02:36:17.6NZ mysqld_safe Logging to '/Applications/MAMP/logs/mysql_error.log'.
2022-10-12T02:36:17.6NZ mysqld_safe Starting mysqld daemon with databases from /Library/Application Support/appsolute/MAMP PRO/db/mysql57
mysqld: [Warning] World-writable config file '/Applications/MAMP/tmp/mysql/my.cnf' is ignored.
2022-10-12T02:36:17.347806Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2022-10-12T02:36:17.349461Z 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled
2022-10-12T02:36:17.350939Z 0 [Note] /Applications/MAMP/Library/bin/mysqld (mysqld 5.7.34) starting as process 62124 ...
2022-10-12T02:36:17.363631Z 0 [Warning] Setting lower_case_table_names=2 because file system for /Library/Application Support/appsolute/MAMP PRO/db/mysql57/ is case insensitive
2022-10-12T02:36:17.373326Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2022-10-12T02:36:17.373353Z 0 [Note] InnoDB: Uses event mutexes
2022-10-12T02:36:17.373365Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2022-10-12T02:36:17.373375Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2022-10-12T02:36:17.375559Z 0 [Note] InnoDB: Number of pools: 1
2022-10-12T02:36:17.378292Z 0 [Note] InnoDB: Using CPU crc32 instructions
2022-10-12T02:36:17.380118Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2022-10-12T02:36:17.390613Z 0 [Note] InnoDB: Completed initialization of buffer pool
2022-10-12T02:36:17.415180Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2022-10-12T02:36:17.418235Z 0 [Note] InnoDB: Log scan progressed past the checkpoint lsn 73772091416
2022-10-12T02:36:17.418356Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 73772146375
2022-10-12T02:36:17.422286Z 0 [Note] InnoDB: Database was not shutdown normally!
2022-10-12T02:36:17.422329Z 0 [Note] InnoDB: Starting crash recovery.
2022-10-12T02:36:17.467479Z 0 [Note] InnoDB: Starting an apply batch of log records to the database...
InnoDB: Progress in percent: 0 1 2 3 4 5 6 7 8 2022-10-12T02:36:17.468325Z 0 [ERROR] InnoDB: Trying to access page number 32 in space 580, space name drupal8/cache_menu, which is outside the tablespace bounds. Byte offset 0, len 16384, i/o type read. If you get this error at mysqld startup, please check that your my.cnf matches the ibdata files that you have in the MySQL server.
2022-10-12T02:36:17.468359Z 0 [ERROR] InnoDB: Server exits.
2022-10-12T02:36:17.6NZ mysqld_safe mysqld from pid file /Applications/MAMP/tmp/mysql/mysql.pid ended
When I open PhpMyAdmin I get an error as well:
PHP 5.5+ is required.
Currently installed version is: 5.4.45
But I have PHP set to 7.4.21 in MAMP.

MySQL docker: Import schema file with error: inet addr:'| cut -d: -f2 | awk '{ print $1}'", "commandName": "IP"}], "clamAvInt'

I am working with MySQL docker image version 5.7 with initialize the data by the schema file but got some error can't solve.
My docker command line is:
docker run --name mysql -e MYSQL_ROOT_PASSWORD='abc123' -v /Users/jenkins/Desktop/irms:/docker-entrypoint-initdb.d mysql:5.7
and get the error, the log as below:
$ docker run --name mysql -e MYSQL_ROOT_PASSWORD='abc123' -v /Users/jenkins/Desktop/irms:/docker-entrypoint-initdb.d mysql:5.7
2021-03-17 02:05:15+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.33-1debian10 started.
2021-03-17 02:05:15+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2021-03-17 02:05:15+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.33-1debian10 started.
2021-03-17 02:05:15+00:00 [Note] [Entrypoint]: Initializing database files
2021-03-17T02:05:15.606058Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2021-03-17T02:05:15.756090Z 0 [Warning] InnoDB: New log files created, LSN=45790
2021-03-17T02:05:15.779384Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2021-03-17T02:05:15.837663Z 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: 373d4ffb-86c5-11eb-8780-0242ac110002.
2021-03-17T02:05:15.839186Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2021-03-17T02:05:16.450734Z 0 [Warning] CA certificate ca.pem is self signed.
2021-03-17T02:05:16.576740Z 1 [Warning] root#localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
2021-03-17 02:05:18+00:00 [Note] [Entrypoint]: Database files initialized
2021-03-17 02:05:18+00:00 [Note] [Entrypoint]: Starting temporary server
2021-03-17 02:05:18+00:00 [Note] [Entrypoint]: Waiting for server startup
2021-03-17T02:05:18.819727Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2021-03-17T02:05:18.820623Z 0 [Note] mysqld (mysqld 5.7.33) starting as process 78 ...
2021-03-17T02:05:18.822725Z 0 [Note] InnoDB: PUNCH HOLE support available
2021-03-17T02:05:18.822772Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2021-03-17T02:05:18.822783Z 0 [Note] InnoDB: Uses event mutexes
2021-03-17T02:05:18.822789Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2021-03-17T02:05:18.822795Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2021-03-17T02:05:18.822800Z 0 [Note] InnoDB: Using Linux native AIO
2021-03-17T02:05:18.823072Z 0 [Note] InnoDB: Number of pools: 1
2021-03-17T02:05:18.823301Z 0 [Note] InnoDB: Using CPU crc32 instructions
2021-03-17T02:05:18.824551Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2021-03-17T02:05:18.829149Z 0 [Note] InnoDB: Completed initialization of buffer pool
2021-03-17T02:05:18.830692Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2021-03-17T02:05:18.841912Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2021-03-17T02:05:18.846985Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2021-03-17T02:05:18.847098Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2021-03-17T02:05:18.862891Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2021-03-17T02:05:18.863475Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2021-03-17T02:05:18.863521Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2021-03-17T02:05:18.863960Z 0 [Note] InnoDB: Waiting for purge to start
2021-03-17T02:05:18.914486Z 0 [Note] InnoDB: 5.7.33 started; log sequence number 2746831
2021-03-17T02:05:18.915203Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2021-03-17T02:05:18.915523Z 0 [Note] Plugin 'FEDERATED' is disabled.
2021-03-17T02:05:18.916967Z 0 [Note] InnoDB: Buffer pool(s) load completed at 210317 2:05:18
2021-03-17T02:05:18.920098Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
2021-03-17T02:05:18.920168Z 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory.
2021-03-17T02:05:18.920570Z 0 [Warning] CA certificate ca.pem is self signed.
2021-03-17T02:05:18.920635Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.
2021-03-17T02:05:18.922497Z 0 [Warning] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
2021-03-17T02:05:18.926990Z 0 [Note] Event Scheduler: Loaded 0 events
2021-03-17T02:05:18.927219Z 0 [Note] mysqld: ready for connections.
Version: '5.7.33' socket: '/var/run/mysqld/mysqld.sock' port: 0 MySQL Community Server (GPL)
2021-03-17 02:05:19+00:00 [Note] [Entrypoint]: Temporary server started.
Warning: Unable to load '/usr/share/zoneinfo/iso3166.tab' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/leap-seconds.list' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/zone.tab' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/zone1970.tab' as time zone. Skipping it.
2021-03-17 02:05:20+00:00 [Note] [Entrypoint]: /usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/IRMSDB_2021-03-09.sql
ERROR 1064 (42000) at line 287: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'inet addr:'| cut -d: -f2 | awk '{ print $1}'", "commandName": "IP"}], "clamAvInt' at line 5
I checked my schema file and no idea what the error exactly and no idea how to fix it.
My schema file is exported from Sequel Pro.
Could you kindly provide some idea to solve the problem?
Thanks very much.
Just attached my schema file below, and please change the extension name from jpg to SQL.
Click here to download: MySQL schema file

Can no longer run mysql with homebrew

I had mysql running fine on my Mac running High Sierra, 10.13.5. Last night, however, the system rebooted in the middle of the night for some unknown reason and I haven't been able to get things back and running properly since.
When I run brew services start mysql I get:
Successfully startedmysql(label: homebrew.mxcl.mysql)
in response. However, ps aux | grep mysql shows no running server and I cannot log into mysql. If I run, mysql.server start I get:
. ERROR! The server quit without updating PID file (/usr/local/var/mysql/iMac-5K-3.local.pid).
The error file contents are as follows:
2018-06-18T13:51:57.6NZ mysqld_safe mysqld from pid file /usr/local/var/mysql/iMac-5K-3.local.pid ended
2018-06-18T13:52:07.6NZ mysqld_safe Logging to '/usr/local/var/mysql/iMac-5K-3.local.err'.
2018-06-18T13:52:07.6NZ mysqld_safe Starting mysqld daemon with databases from /usr/local/var/mysql
2018-06-18T13:52:07.837840Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-06-18T13:52:07.838096Z 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-06-18T13:52:07.838155Z 0 [Note] /usr/local/opt/mysql/bin/mysqld (mysqld 5.7.22) starting as process 8334 ...
2018-06-18T13:52:07.840681Z 0 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/var/mysql/ is case insensitive
2018-06-18T13:52:07.841958Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-06-18T13:52:07.841975Z 0 [Note] InnoDB: Uses event mutexes
2018-06-18T13:52:07.841983Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2018-06-18T13:52:07.841990Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2018-06-18T13:52:07.842257Z 0 [Note] InnoDB: Number of pools: 1
2018-06-18T13:52:07.842356Z 0 [Note] InnoDB: Using CPU crc32 instructions
2018-06-18T13:52:07.843494Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2018-06-18T13:52:07.852043Z 0 [Note] InnoDB: Completed initialization of buffer pool
2018-06-18T13:52:07.901671Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2018-06-18T13:52:07.902006Z 0 [ERROR] InnoDB: Ignoring the redo log due to missing MLOG_CHECKPOINT between the checkpoint 2700829144 and the end 2700828672.
2018-06-18T13:52:07.902049Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2018-06-18T13:52:08.338717Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2018-06-18T13:52:08.338812Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2018-06-18T13:52:08.338823Z 0 [ERROR] Failed to initialize builtin plugins.
2018-06-18T13:52:08.338835Z 0 [ERROR] Aborting
2018-06-18T13:52:08.338849Z 0 [Note] Binlog end
2018-06-18T13:52:08.338929Z 0 [Note] Shutting down plugin 'CSV'
2018-06-18T13:52:08.339077Z 0 [Note] /usr/local/opt/mysql/bin/mysqld: Shutdown complete
2018-06-18T13:52:08.6NZ mysqld_safe mysqld from pid file /usr/local/var/mysql/iMac-5K-3.local.pid ended
OK, found the solution here.
I didn't bother with step 1 since I don't have a master/slave setup. I just did:
mv /var/lib/mysql/ib_logfile* ~
I can now start mysql successfully.

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

PHPMyadmin Error: #2002 - No such file or directory<br />The server is not responding

I have phpMyAdmin installed on Ubuntu 16.04 Lamp Server on an Oracle VM. When I try to enter phpMyAdmin via http://localhost/phpmyadmin, I receive the following error:
Error: #2002 - No such file or directoryThe server is not responding
After reading previous threads, I have tried to unsuccessfully reinstall mysql-server to no avail. The MySQL error log in /var/log/... contains the following:
2017-01-22T16:18:06.214161Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000)
2017-01-22T16:18:06.214326Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)
2017-01-22T16:18:06.536519Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-01-22T16:18:06.543467Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.17-0ubuntu0.16.04.1) starting as process 3647 ...
2017-01-22T16:18:06.571026Z 0 [Note] InnoDB: PUNCH HOLE support available
2017-01-22T16:18:06.571095Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2017-01-22T16:18:06.571106Z 0 [Note] InnoDB: Uses event mutexes
2017-01-22T16:18:06.571120Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2017-01-22T16:18:06.571130Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.8
2017-01-22T16:18:06.571139Z 0 [Note] InnoDB: Using Linux native AIO
2017-01-22T16:18:06.571731Z 0 [Note] InnoDB: Number of pools: 1
2017-01-22T16:18:06.571975Z 0 [Note] InnoDB: Using CPU crc32 instructions
2017-01-22T16:18:06.577202Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2017-01-22T16:18:06.625715Z 0 [Note] InnoDB: Completed initialization of buffer pool
2017-01-22T16:18:06.631873Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2017-01-22T16:18:06.647876Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2017-01-22T16:18:06.736500Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2017-01-22T16:18:06.736633Z 0 [Note] InnoDB: Setting file \'./ibtmp1\' size to 12 MB. Physically writing the file full; Please wait ...
2017-01-22T16:18:07.143892Z 0 [Note] InnoDB: File \'./ibtmp1\' size is now 12 MB.
2017-01-22T16:18:07.145163Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2017-01-22T16:18:07.145188Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2017-01-22T16:18:07.150769Z 0 [Note] InnoDB: Waiting for purge to start
2017-01-22T16:18:07.201406Z 0 [Note] InnoDB: 5.7.17 started; log sequence number 16765716
2017-01-22T16:18:07.207484Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2017-01-22T16:18:07.208190Z 0 [Note] InnoDB: Buffer pool(s) load completed at 170122 17:18:07
2017-01-22T16:18:07.208412Z 0 [Note] Plugin \'FEDERATED\' is disabled.
2017-01-22T16:18:07.229256Z 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-01-22T16:18:07.229286Z 0 [Note] Server hostname (bind-address): \'127.0.0.1\'; port: 3306
2017-01-22T16:18:07.229302Z 0 [Note] - \'127.0.0.1\' resolves to \'127.0.0.1\';
2017-01-22T16:18:07.229351Z 0 [Note] Server socket created on IP: \'127.0.0.1\'.
2017-01-22T16:18:07.230207Z 0 [ERROR] Fatal error: Can\'t open and lock privilege tables: Incorrect file format \'user\'
2017-01-22T16:18:07.230287Z 0 [ERROR] Aborting
');
I have tried to apply various solutions including this - MySQL Fatal error: Can't open and lock privilege tables: Incorrect file format 'user'
Unfortunately, I am not able to access Mysql and therefore unable to follow the solution. $ sudo mysqld --skip-grant-tables does not allow me to access it.