Wordpress database shutdowns - mysql

I've been having problems with one of my site. Every so often it an error comes up when I load my site "Database Connection Failed".
I am using a Amazon Linux server t2.micro instance.
Please can someone help I am desperate. I have no idea what is the problem and I am quite new at this stuff so I don't want to make any changes without knowing and I lose data.
Thanks
My mysql log file:
170103 18:00:02 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
InnoDB: Doing recovery: scanned up to log sequence number 2104460177
170103 18:00:02 InnoDB: Starting an apply batch of log records to the database...
InnoDB: Progress in percents: 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
InnoDB: Apply batch completed
170103 18:00:02 InnoDB: Waiting for the background threads to start
170103 18:00:03 InnoDB: 5.5.52 started; log sequence number 2104460177
170103 18:00:03 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
170103 18:00:03 [Note] - '0.0.0.0' resolves to '0.0.0.0';
170103 18:00:03 [Note] Server socket created on IP: '0.0.0.0'.
170103 18:00:04 [Note] Event Scheduler: Loaded 0 events
170103 18:00:04 [Note] /usr/libexec/mysql55/mysqld: ready for connections.
Version: '5.5.52' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL)
170104 09:09:11 mysqld_safe Number of processes running now: 0
170104 09:09:11 mysqld_safe mysqld restarted
170104 09:27:17 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
170104 9:27:17 [Note] /usr/libexec/mysql55/mysqld (mysqld 5.5.52) starting as process 11744 ...
170104 9:27:17 [Note] Plugin 'FEDERATED' is disabled.
170104 9:27:17 InnoDB: The InnoDB memory heap is disabled
170104 9:27:17 InnoDB: Mutexes and rw_locks use GCC atomic builtins
170104 9:27:17 InnoDB: Compressed tables use zlib 1.2.8
170104 9:27:17 InnoDB: Using Linux native AIO
170104 9:27:17 InnoDB: Initializing buffer pool, size = 128.0M
170104 9:27:17 InnoDB: Completed initialization of buffer pool
170104 9:27:17 InnoDB: highest supported file format is Barracuda.
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
170104 9:27:17 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
170104 9:27:17 InnoDB: Waiting for the background threads to start
170104 9:27:18 InnoDB: 5.5.52 started; log sequence number 2123585383
170104 9:27:18 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
170104 9:27:18 [Note] - '0.0.0.0' resolves to '0.0.0.0';
170104 9:27:18 [Note] Server socket created on IP: '0.0.0.0'.
170104 9:27:18 [Note] Event Scheduler: Loaded 0 events
170104 9:27:18 [Note] /usr/libexec/mysql55/mysqld: ready for connections.
Version: '5.5.52' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL)

Your MySQL seems to have not enough RAM.
Let's say you got a guy (mysql) who carries a package of stones(data in mysql) from point a to point b over a bridge.
By the times you add more stones(more data) to the package.
And maybe there are also more guys (more mysql instances, because more visitors on your website) on the street.
Then imagine a bridge where all this guys have to pass, which has a weight limit (RAM).
So only a few guys can walk over the bridge and others are told to either wait or (if there are too many guys waiting) go to hell with their packages.
You may either delete some data or you may limit the amounts of users or you can try to optimize the packages.
Do you really need to carry all the data or is there a way to produce the data faster?
For the second option read about mysql indexes.

Related

How to access db [Error: ER_ACCESS_DENIED_ERROR: Access denied for user 'root'#'172.18.0.3' (using password: YES)] in docker container

I have the following docker-compose.yml file.
I would like to buildthem and connect to DB
version: '3'
services:
api-server:
build: ./api
links:
- 'db'
ports:
- '3000:3000'
volumes:
- ./api:/src
- ./src/node_modules
tty: true
container_name: api-server
db:
build:
context: .
dockerfile: ./db/Dockerfile
restart: always
hostname: db
environment:
MYSQL_ROOT_PASSWORD: test
MYSQL_USER: root
MYSQL_PASSWORD: test
MYSQL_DATABASE: db
volumes:
- './db:/config'
ports:
- 3306:3306
container_name: db
After docker-compose build
then docker-compose up -d
And then `docker exec -it api-server sh'
I could enter containers. and tried
yarn ts-node node_modules/.bin/typeorm migration:show
typeorm command which connect to DB
But it returned
Error during migration show: Error: ER_ACCESS_DENIED_ERROR: Access denied for user 'root'#'172.18.0.3' (using password: YES)
Are there any way to fix it?
Where is the wrong point of it ?
Thanks
Here is docker logs db
docker logs db
2020-09-15 11:57:44+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.31-1debian10 started.
2020-09-15 11:57:44+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2020-09-15 11:57:44+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.31-1debian10 started.
2020-09-15 11:57:44+00:00 [Note] [Entrypoint]: Initializing database files
2020-09-15T11:57:44.868762Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2020-09-15T11:57:46.939481Z 0 [Warning] InnoDB: New log files created, LSN=45790
2020-09-15T11:57:47.252278Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2020-09-15T11:57:47.327831Z 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: abfbf3cb-f74a-11ea-bfe8-0242ac120002.
2020-09-15T11:57:47.331570Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2020-09-15T11:57:48.443477Z 0 [Warning] CA certificate ca.pem is self signed.
2020-09-15T11:57:48.733702Z 1 [Warning] root#localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
2020-09-15 11:57:52+00:00 [Note] [Entrypoint]: Database files initialized
2020-09-15 11:57:52+00:00 [Note] [Entrypoint]: Starting temporary server
2020-09-15 11:57:52+00:00 [Note] [Entrypoint]: Waiting for server startup
2020-09-15T11:57:52.490209Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2020-09-15T11:57:52.492212Z 0 [Note] mysqld (mysqld 5.7.31) starting as process 77 ...
2020-09-15T11:57:52.497001Z 0 [Note] InnoDB: PUNCH HOLE support available
2020-09-15T11:57:52.497114Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2020-09-15T11:57:52.497223Z 0 [Note] InnoDB: Uses event mutexes
2020-09-15T11:57:52.497332Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2020-09-15T11:57:52.497452Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2020-09-15T11:57:52.497542Z 0 [Note] InnoDB: Using Linux native AIO
2020-09-15T11:57:52.498106Z 0 [Note] InnoDB: Number of pools: 1
2020-09-15T11:57:52.498434Z 0 [Note] InnoDB: Using CPU crc32 instructions
2020-09-15T11:57:52.501015Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2020-09-15T11:57:52.515593Z 0 [Note] InnoDB: Completed initialization of buffer pool
2020-09-15T11:57:52.518852Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2020-09-15T11:57:52.531163Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2020-09-15T11:57:52.555422Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2020-09-15T11:57:52.555698Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2020-09-15T11:57:52.665854Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2020-09-15T11:57:52.667159Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2020-09-15T11:57:52.667286Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2020-09-15T11:57:52.668320Z 0 [Note] InnoDB: 5.7.31 started; log sequence number 2720554
2020-09-15T11:57:52.669761Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2020-09-15T11:57:52.669911Z 0 [Note] Plugin 'FEDERATED' is disabled.
2020-09-15T11:57:52.672485Z 0 [Note] InnoDB: Buffer pool(s) load completed at 200915 11:57:52
2020-09-15T11:57:52.683725Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
2020-09-15T11:57:52.683951Z 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory.
2020-09-15T11:57:52.684864Z 0 [Warning] CA certificate ca.pem is self signed.
2020-09-15T11:57:52.684970Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.
2020-09-15T11:57:52.687815Z 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.
2020-09-15T11:57:52.704435Z 0 [Note] Event Scheduler: Loaded 0 events
2020-09-15T11:57:52.705512Z 0 [Note] mysqld: ready for connections.
Version: '5.7.31' socket: '/var/run/mysqld/mysqld.sock' port: 0 MySQL Community Server (GPL)
2020-09-15 11:57:53+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.
2020-09-15 11:58:00+00:00 [Note] [Entrypoint]: Creating database mogucare_db
2020-09-15 11:58:00+00:00 [Note] [Entrypoint]: Creating user root
ERROR 1396 (HY000) at line 1: Operation CREATE USER failed for 'root'#'%'
2020-09-15 11:58:02+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.31-1debian10 started.
2020-09-15 11:58:03+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2020-09-15 11:58:03+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.31-1debian10 started.
2020-09-15T11:58:03.406842Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2020-09-15T11:58:03.409690Z 0 [Note] mysqld (mysqld 5.7.31) starting as process 1 ...
2020-09-15T11:58:03.418038Z 0 [Note] InnoDB: PUNCH HOLE support available
2020-09-15T11:58:03.418101Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2020-09-15T11:58:03.418117Z 0 [Note] InnoDB: Uses event mutexes
2020-09-15T11:58:03.418133Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2020-09-15T11:58:03.418152Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2020-09-15T11:58:03.418170Z 0 [Note] InnoDB: Using Linux native AIO
2020-09-15T11:58:03.419647Z 0 [Note] InnoDB: Number of pools: 1
2020-09-15T11:58:03.420784Z 0 [Note] InnoDB: Using CPU crc32 instructions
2020-09-15T11:58:03.425652Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2020-09-15T11:58:03.448462Z 0 [Note] InnoDB: Completed initialization of buffer pool
2020-09-15T11:58:03.457474Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2020-09-15T11:58:03.473399Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2020-09-15T11:58:03.477057Z 0 [Note] InnoDB: Log scan progressed past the checkpoint lsn 2720554
2020-09-15T11:58:03.737975Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 7963136
2020-09-15T11:58:03.934900Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 12578409
2020-09-15T11:58:03.936536Z 0 [Note] InnoDB: Database was not shutdown normally!
2020-09-15T11:58:03.936685Z 0 [Note] InnoDB: Starting crash recovery.
2020-09-15T11:58:04.147681Z 0 [Note] InnoDB: Starting an apply batch of log records to the database...
InnoDB: Progress in percent: 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
2020-09-15T11:58:05.179148Z 0 [Note] InnoDB: Apply batch completed
2020-09-15T11:58:05.286743Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2020-09-15T11:58:05.286809Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2020-09-15T11:58:05.286925Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2020-09-15T11:58:05.374586Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2020-09-15T11:58:05.376546Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2020-09-15T11:58:05.377004Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2020-09-15T11:58:05.378022Z 0 [Note] InnoDB: Waiting for purge to start
2020-09-15T11:58:05.439607Z 0 [Note] InnoDB: 5.7.31 started; log sequence number 12578409
2020-09-15T11:58:05.442005Z 0 [Note] Plugin 'FEDERATED' is disabled.
2020-09-15T11:58:05.454028Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2020-09-15T11:58:05.492756Z 0 [Note] InnoDB: Buffer pool(s) load completed at 200915 11:58:05
2020-09-15T11:58:05.518753Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
2020-09-15T11:58:05.518785Z 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory.
2020-09-15T11:58:05.519497Z 0 [Warning] CA certificate ca.pem is self signed.
2020-09-15T11:58:05.519541Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.
2020-09-15T11:58:05.536601Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
2020-09-15T11:58:05.537666Z 0 [Note] IPv6 is available.
2020-09-15T11:58:05.537947Z 0 [Note] - '::' resolves to '::';
2020-09-15T11:58:05.538239Z 0 [Note] Server socket created on IP: '::'.
2020-09-15T11:58:05.552491Z 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.
2020-09-15T11:58:05.574297Z 0 [Note] Event Scheduler: Loaded 0 events
2020-09-15T11:58:05.574997Z 0 [Note] mysqld: ready for connections.
Version: '5.7.31' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server (GPL)
2020-09-15T11:59:47.472547Z 3 [Note] Access denied for user 'root'#'172.18.0.3' (using password: YES)
2020-09-15T12:03:15.760923Z 4 [Note] Access denied for user 'root'#'172.18.0.3' (using password: YES)
The reason is in MySQL database mysql, table users. The user you are connecting with doesn't have permission - either because it doesn't exist, you have the wrong password, or you have no rights to connect from your IP to the target database.
In many cases, MySQL docker containers come configured to only allow connections to localhost (127.0.0.1) which means you must either (a) use port forwarding or (b) grant the user permission to connect from anywhere (i.e. %). Sometimes there is also a configuration switch that will automatically do this for you - read the documentation for your db container.

Database connection error in wordpress

My site is on Wordpress and is hosted on a VPS server. The traffic is not much but the database connect error is displayed many times, and then I had to restart MySQL.
I've checked the MySQL error file log. Here is a certain portion of the log.
140310 01:13:26 mysqld_safe mysqld from pid file /var/lib/mysql/server.gosoftnep.com.pid ended
140310 01:13:26 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
140310 1:13:26 [Note] Plugin 'FEDERATED' is disabled.
140310 1:13:26 InnoDB: The InnoDB memory heap is disabled
140310 1:13:26 InnoDB: Mutexes and rw_locks use GCC atomic builtins
140310 1:13:26 InnoDB: Compressed tables use zlib 1.2.3
140310 1:13:26 InnoDB: Using Linux native AIO
140310 1:13:26 InnoDB: Initializing buffer pool, size = 128.0M
140310 1:13:26 InnoDB: Completed initialization of buffer pool
140310 1:13:26 InnoDB: highest supported file format is Barracuda.
140310 1:13:26 InnoDB: Waiting for the background threads to start
140310 1:13:27 InnoDB: 5.5.36 started; log sequence number 12082242998
140310 1:13:27 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
140310 1:13:27 [Note] - '0.0.0.0' resolves to '0.0.0.0';
140310 1:13:27 [Note] Server socket created on IP: '0.0.0.0'.
140310 1:13:27 [Note] Event Scheduler: Loaded 0 events
140310 1:13:27 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.5.36-cll' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL)
140310 01:13:32 mysqld_safe A mysqld process already exists
140310 5:52:48 [Warning] IP address '58.118.152.8' could not be resolved: Temporary failure in name resolution
140310 12:27:37 mysqld_safe Number of processes running now: 0
140310 12:27:38 mysqld_safe mysqld restarted
140310 12:27:44 [Note] Plugin 'FEDERATED' is disabled.
140310 12:27:45 InnoDB: The InnoDB memory heap is disabled
140310 12:27:45 InnoDB: Mutexes and rw_locks use GCC atomic builtins
140310 12:27:45 InnoDB: Compressed tables use zlib 1.2.3
140310 12:27:45 InnoDB: Using Linux native AIO
140310 12:27:47 InnoDB: Initializing buffer pool, size = 128.0M
140310 12:27:49 InnoDB: Completed initialization of buffer pool
140310 12:27:50 InnoDB: highest supported file format is Barracuda.
InnoDB: Log scan progressed past the checkpoint lsn 12354557593
140310 12:27:52 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
InnoDB: Doing recovery: scanned up to log sequence number 12354588661
140310 12:28:05 InnoDB: Starting an apply batch of log records to the database...
InnoDB: Progress in percents: 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
InnoDB: Apply batch completed
140310 12:28:07 InnoDB: Waiting for the background threads to start
140310 12:28:08 InnoDB: 5.5.36 started; log sequence number 12354588661
140310 12:28:08 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
140310 12:28:08 [Note] - '0.0.0.0' resolves to '0.0.0.0';
140310 12:28:08 [Note] Server socket created on IP: '0.0.0.0'.
140310 12:28:12 [Note] Event Scheduler: Loaded 0 events
140310 12:28:12 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.5.36-cll' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL)
140311 11:51:59 [Warning] IP address '61.160.249.239' could not be resolved: Name or service not known
140312 9:23:21 [Warning] IP address '183.60.107.205' could not be resolved: Name or service not known
140313 0:33:47 [Warning] IP address '221.228.231.59' could not be resolved: Name or service not known
140313 7:33:05 [Warning] IP address '61.147.103.160' could not be resolved: Name or service not known
140313 20:42:42 [Warning] IP address '124.89.32.242' could not be resolved: Name or service not known
140313 23:33:38 mysqld_safe Number of processes running now: 0
140313 23:33:38 mysqld_safe mysqld restarted
140313 23:34:09 [Note] Plugin 'FEDERATED' is disabled.
140313 23:34:14 InnoDB: The InnoDB memory heap is disabled
140313 23:34:14 InnoDB: Mutexes and rw_locks use GCC atomic builtins
140313 23:34:14 InnoDB: Compressed tables use zlib 1.2.3
140313 23:34:14 InnoDB: Using Linux native AIO
140313 23:34:17 InnoDB: Initializing buffer pool, size = 128.0M
140313 23:34:20 InnoDB: Completed initialization of buffer pool
140313 23:34:30 mysqld_safe mysqld from pid file /var/lib/mysql/server.gosoftnep.com.pid ended
140314 02:55:09 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
140314 2:55:10 [Note] Plugin 'FEDERATED' is disabled.
140314 2:55:10 InnoDB: The InnoDB memory heap is disabled
140314 2:55:10 InnoDB: Mutexes and rw_locks use GCC atomic builtins
140314 2:55:10 InnoDB: Compressed tables use zlib 1.2.3
140314 2:55:10 InnoDB: Using Linux native AIO
140314 2:55:10 InnoDB: Initializing buffer pool, size = 128.0M
140314 2:55:10 InnoDB: Completed initialization of buffer pool
140314 2:55:10 InnoDB: highest supported file format is Barracuda.
InnoDB: Log scan progressed past the checkpoint lsn 14587500130
140314 2:55:10 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
InnoDB: Doing recovery: scanned up to log sequence number 14587535674
140314 2:55:11 InnoDB: Starting an apply batch of log records to the database...
InnoDB: Progress in percents: 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
InnoDB: Apply batch completed
140314 2:55:11 InnoDB: Waiting for the background threads to start
140314 2:55:12 InnoDB: 5.5.36 started; log sequence number 14587535674
140314 2:55:12 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
140314 2:55:12 [Note] - '0.0.0.0' resolves to '0.0.0.0';
140314 2:55:12 [Note] Server socket created on IP: '0.0.0.0'.
140314 2:55:12 [Note] Event Scheduler: Loaded 0 events
140314 2:55:12 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.5.36-cll' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL)
I do not understand anything about this. Could anyone explain the issue to me or suggest a fix?

Mysql innoDB keeps crashing [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
My database (mysql) server keeps crashing / restarting and I am at a loss of what to do. I keep getting the following in my dbname.org.err file:
131205 18:49:05 mysqld_safe mysqld from pid file /var/lib/mysql/les.lesplan.org.pid ended
131205 18:50:12 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
131205 18:50:12 [Note] Plugin 'FEDERATED' is disabled.
131205 18:50:12 InnoDB: The InnoDB memory heap is disabled
131205 18:50:12 InnoDB: Mutexes and rw_locks use GCC atomic builtins
131205 18:50:12 InnoDB: Compressed tables use zlib 1.2.3
131205 18:50:12 InnoDB: Using Linux native AIO
131205 18:50:12 InnoDB: Initializing buffer pool, size = 128.0M
131205 18:50:12 InnoDB: Completed initialization of buffer pool
131205 18:50:12 InnoDB: highest supported file format is Barracuda.
131205 18:50:12 InnoDB: Waiting for the background threads to start
131205 18:50:13 InnoDB: 5.5.32 started; log sequence number 94296300
131205 18:50:13 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
131205 18:50:13 [Note] - '0.0.0.0' resolves to '0.0.0.0';
131205 18:50:13 [Note] Server socket created on IP: '0.0.0.0'.
131205 18:50:14 [Note] Event Scheduler: Loaded 0 events
131205 18:50:14 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.5.32-cll' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL)
131206 07:32:53 mysqld_safe Number of processes running now: 0
131206 07:32:53 mysqld_safe mysqld restarted
131206 7:32:54 [Note] Plugin 'FEDERATED' is disabled.
131206 7:32:54 InnoDB: The InnoDB memory heap is disabled
131206 7:32:54 InnoDB: Mutexes and rw_locks use GCC atomic builtins
131206 7:32:54 InnoDB: Compressed tables use zlib 1.2.3
131206 7:32:54 InnoDB: Using Linux native AIO
131206 7:32:54 InnoDB: Initializing buffer pool, size = 128.0M
131206 7:32:54 InnoDB: Completed initialization of buffer pool
131206 7:32:54 InnoDB: highest supported file format is Barracuda.
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
131206 7:32:54 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
131206 7:32:54 InnoDB: Waiting for the background threads to start
131206 7:32:55 InnoDB: 5.5.32 started; log sequence number 94790638
131206 7:32:55 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
131206 7:32:55 [Note] - '0.0.0.0' resolves to '0.0.0.0';
131206 7:32:55 [Note] Server socket created on IP: '0.0.0.0'.
131206 7:32:55 [Note] Event Scheduler: Loaded 0 events
131206 7:32:55 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.5.32-cll' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL)
131206 07:33:07 mysqld_safe Number of processes running now: 0
131206 07:33:07 mysqld_safe mysqld restarted
131206 7:33:07 [Note] Plugin 'FEDERATED' is disabled.
131206 7:33:07 InnoDB: The InnoDB memory heap is disabled
131206 7:33:07 InnoDB: Mutexes and rw_locks use GCC atomic builtins
131206 7:33:07 InnoDB: Compressed tables use zlib 1.2.3
131206 7:33:07 InnoDB: Using Linux native AIO
131206 7:33:07 InnoDB: Initializing buffer pool, size = 128.0M
131206 7:33:07 InnoDB: Completed initialization of buffer pool
131206 7:33:07 InnoDB: highest supported file format is Barracuda.
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
131206 7:33:07 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
131206 7:33:08 InnoDB: Waiting for the background threads to start
131206 7:33:09 InnoDB: 5.5.32 started; log sequence number 94790648
131206 7:33:09 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
131206 7:33:09 [Note] - '0.0.0.0' resolves to '0.0.0.0';
131206 7:33:09 [Note] Server socket created on IP: '0.0.0.0'.
131206 7:33:09 [Note] Event Scheduler: Loaded 0 events
131206 7:33:09 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.5.32-cll' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL)
131206 07:38:38 mysqld_safe Number of processes running now: 0
131206 07:38:38 mysqld_safe mysqld restarted
131206 7:38:38 [Note] Plugin 'FEDERATED' is disabled.
131206 7:38:38 InnoDB: The InnoDB memory heap is disabled
131206 7:38:38 InnoDB: Mutexes and rw_locks use GCC atomic builtins
131206 7:38:38 InnoDB: Compressed tables use zlib 1.2.3
131206 7:38:38 InnoDB: Using Linux native AIO
131206 7:38:38 InnoDB: Initializing buffer pool, size = 128.0M
131206 7:38:38 InnoDB: Completed initialization of buffer pool
131206 7:38:38 InnoDB: highest supported file format is Barracuda.
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
131206 7:38:38 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
131206 7:38:38 InnoDB: Waiting for the background threads to start
131206 7:38:39 InnoDB: 5.5.32 started; log sequence number 94790674
131206 7:38:39 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
131206 7:38:39 [Note] - '0.0.0.0' resolves to '0.0.0.0';
131206 7:38:39 [Note] Server socket created on IP: '0.0.0.0'.
131206 7:38:39 [Note] Event Scheduler: Loaded 0 events
131206 7:38:39 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.5.32-cll' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL)
root#les [/var/lib/mysql]#
The server 'crashes' and restarts at seemingly random intervals although it does happen around 7:30 am (+/- 30 minutes) more then other times it seems.
There are no cron jobs running anywhere near this time.
Any help would be appreciated!
ss
Drop your ib_log files and Put innodb_force_recovery=6 in config file and restart your mysql it will resolve
Turns out that from time to time, memory usage would spike (I'm guessing that this was because of a dramatic spike in apache child processes) and this would cause memory pressure. The out-of-memory killer would choose mysql to close down, because it was (usually) the biggest memory user in the system.
So to fix, I
got more memory
fine tuned Apache to control the number of child processes that were spun up.

MySQL ...Starting crash recovery

I have searched high and low for a solution to this problem. My MySql gives me the following readout:
121231 20:41:05 [Note] Plugin 'FEDERATED' is disabled.
121231 20:41:05 InnoDB: The InnoDB memory heap is disabled
121231 20:41:05 InnoDB: Mutexes and rw_locks use Windows interlocked functions
121231 20:41:05 InnoDB: Compressed tables use zlib 1.2.3
121231 20:41:05 InnoDB: Initializing buffer pool, size = 512.0M
121231 20:41:05 InnoDB: Completed initialization of buffer pool
121231 20:41:05 InnoDB: highest supported file format is Barracuda.
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
121231 20:41:05 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
121231 20:41:06 InnoDB: Waiting for the background threads to start
121231 20:41:07 InnoDB: 1.1.8 started; log sequence number 124716458
121231 20:41:07 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
121231 20:41:07 [Note] - '0.0.0.0' resolves to '0.0.0.0';
121231 20:41:07 [Note] Server socket created on IP: '0.0.0.0'.
121231 20:41:09 [Note] Event Scheduler: Loaded 0 events
121231 20:41:09 [Note] c:\xampp\mysql\bin\mysqld.exe: ready for connections.
Version: '5.5.27' socket: '' port: 3306 MySQL Community Server (GPL)
Everytime it starts. I've tried deleting files, dropping the database, running Magento's Repair Database Tool, starting all over with a new database but no matter what I get this error.
It makes me uncomfortable because I'm not sure something might get corrupted or IS corrupted. I'm using Windows Vista, and Xampp but I also was using nginX with the same thing showing.
I just recreated a brand new database and now after shutdown (which I have to do sometimes) the error is showing up again! Is this a normal thing or is there somehing wrong?
Thanks
As you can see from the log InnoDB starts crash recovery:
InnoDB: Starting crash recovery.
The reason for that is MySQL shut down wasn't clean. Why? May be MySQL has been exiting too long and OS kills the process (if you reboot the server). Or MySQL crashes due to a bug.

MySQL Will Not Start - InnoDB: Database was not shut down normally! InnoDB: Starting crash recovery

I am having some problems with MySQL - the service has stopped and will not restart.
I have an XAMPP stack running MediaWiki which is what uses the MySQL database. The server itself is a VM running Windows 2003 SP2 with 512MB RAM.
Below is an extract from the mysql_error.log
121120 16:11:46 [Note] Plugin 'FEDERATED' is disabled.
121120 16:11:46 InnoDB: The InnoDB memory heap is disabled
121120 16:11:46 InnoDB: Mutexes and rw_locks use Windows interlocked functions
121120 16:11:46 InnoDB: Compressed tables use zlib 1.2.3
121120 16:11:46 InnoDB: Initializing buffer pool, size = 16.0M
121120 16:11:46 InnoDB: Completed initialization of buffer pool
121120 16:11:46 InnoDB: highest supported file format is Barracuda.
InnoDB: Log scan progressed past the checkpoint lsn 28821623
121120 16:11:47 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
InnoDB: Doing recovery: scanned up to log sequence number 28825154
121120 16:11:47 InnoDB: Starting an apply batch of log records to the database...
InnoDB: Progress in percents: 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
InnoDB: Apply batch completed
121120 16:11:48 InnoDB: Waiting for the background threads to start
121120 16:11:49 InnoDB: 1.1.8 started; log sequence number 28825154
121120 16:11:49 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
121120 16:11:49 [Note] - '0.0.0.0' resolves to '0.0.0.0';
121120 16:11:49 [Note] Server socket created on IP: '0.0.0.0'.
121120 16:11:49 [Note] Event Scheduler: Loaded 0 events
121120 16:11:49 [Note] d:\xampp\mysql\bin\mysqld.exe: ready for connections.
Version: '5.5.25a' socket: '' port: 3306 MySQL Community Server (GPL)
121120 16:16:41 [Note] Plugin 'FEDERATED' is disabled.
121120 16:16:41 InnoDB: The InnoDB memory heap is disabled
121120 16:16:41 InnoDB: Mutexes and rw_locks use Windows interlocked functions
121120 16:16:41 InnoDB: Compressed tables use zlib 1.2.3
121120 16:16:41 InnoDB: Initializing buffer pool, size = 16.0M
121120 16:16:41 InnoDB: Completed initialization of buffer pool
121120 16:16:41 InnoDB: highest supported file format is Barracuda.
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
121120 16:16:41 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
121120 16:16:42 InnoDB: Waiting for the background threads to start
121120 16:16:43 InnoDB: 1.1.8 started; log sequence number 28841927
121120 16:16:43 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
121120 16:16:43 [Note] - '0.0.0.0' resolves to '0.0.0.0';
121120 16:16:43 [Note] Server socket created on IP: '0.0.0.0'.
121120 16:16:43 [Note] Event Scheduler: Loaded 0 events
121120 16:16:43 [Note] d:\xampp\mysql\bin\mysqld.exe: ready for connections.
Version: '5.5.25a' socket: '' port: 3306 MySQL Community Server (GPL)
Fixes Attempted:
Tried starting from services - error 1067 - "The Process Terminated unexpectedly"
Tried restarting the server itself - no good
Tried moving the ib_logfile0 and ib_logfile1 files from directory and restarting server no good
Tried killing the PID of MySQL from command prompt in case it was still running but it was not running.
If anybody could point me in the right direction it would be much appreciated.
NB> I am also trying to get the RAM of the server increased in case that is the issue. At the moment of the 512MB only about 90MB is free.
thanks
Dwayne