Repetitive mysqld.exe crashes - OS error number 995 & mysql Exception 0x80000003 - mysql

In the last few weeks our mysql DB has been crashing randomly. -
I have ran a check against all the databases for corruption but all are OK.
EDIT 2016.01.14 - The error that keeps popping up commonly is the following -
InnoDB: Database page corruption on disk or a failed
InnoDB: file read of page 0.
Although, the 'File Read Page' is always different, the last time it was Zero, but before that it was 4500.
A little background.
Been running Xampp for over a year without a problem
We have Applications constantly inserting data into MYSQL from lots of data sources, this is 24/7.
Apart from the above applications, nothing else runs around the time of the crash, I have also checked the system logs to see if anything sticks out but it doesn't.
Two weeks ago, we moved to another server with better spec, the old server was cloned and place on the new one.
Nothing has been altered in DB or new tables added.
Within a week, mysql started to produce errors.
The new server specs are as follows -
Windows Server 2008 R2 Standard - Running Service Pack 1
Proccessor: Intel(R) Xeon(R) # 3.3ghz 2x Dual processor
8GB Ram
64Bit OS (Same as old server)
MySQL Version: 5.6.20
PHP Version 5.5.15
Here are the recent error logs -
*************MYSQL ERROR LOG*****************
//////////////////////////////////*********************
ERROR on 2016-01-05
******************///////////////////////
InnoDB: The error means that the I/O operation has been aborted
InnoDB: because of either a thread exit or an application request.
InnoDB: Retry attempt is made.
2016-01-05 08:42:52 cc8 InnoDB: Operating system error number 995 in a file operation.
InnoDB: The error means that the I/O operation has been aborted
InnoDB: because of either a thread exit or an application request.
InnoDB: Retry attempt is made.
2016-01-05 08:42:52 cc8 InnoDB: Operating system error number 995 in a file operation.
InnoDB: The error means that the I/O operation has been aborted
InnoDB: because of either a thread exit or an application request.
InnoDB: Retry attempt is made.
2016-01-05 08:42:53 cc8 InnoDB: Operating system error number 995 in a file operation.
InnoDB: The error means that the I/O operation has been aborted
InnoDB: because of either a thread exit or an application request.
InnoDB: Retry attempt is made.
2016-01-05 08:42:53 cc8 InnoDB: Operating system error number 995 in a file operation.
InnoDB: The error means that the I/O operation has been aborted
InnoDB: because of either a thread exit or an application request.
InnoDB: Retry attempt is made.
//////////////////////////////////*********************
Error- 2015-12-22
********************************///////////////////////////
2015-12-22 16:46:02 12d4 InnoDB: uncompressed page, stored checksum in field1 1169359801, calculated checksums for field1: crc32 4003191917, innodb 1169359801, none 3735928559, stored checksum in field2 4049981449, calculated checksums for field2: crc32 4003191917, innodb 587193584, none 3735928559, page LSN 128 4137924960, low 4 bytes of LSN at page end 4137853843, page number (if stored to page already) 0, space id (if created with >= MySQL-4.1.1 and stored already) 252
InnoDB: Page may be a file space header page
InnoDB: Database page corruption on disk or a failed
InnoDB: file read of page 0.
InnoDB: You may have to recover from a backup.
InnoDB: It is also possible that your operating
InnoDB: system has corrupted its own file cache
InnoDB: and rebooting your computer removes the
InnoDB: error.
InnoDB: If the corrupt page is an index page
InnoDB: you can also try to fix the corruption
InnoDB: by dumping, dropping, and reimporting
InnoDB: the corrupt table. You can use CHECK
InnoDB: TABLE to scan your table for corruption.
InnoDB: See also http://dev.mysql.com/doc/refman/5.6/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
InnoDB: Database page corruption on disk or a failed
InnoDB: file read of page 0.
InnoDB: You may have to recover from a backup.
2015-12-22 16:46:02 12d4 InnoDB: Page dump in ascii and hex (16384 bytes): // Lots of binary here ..
InnoDB: End of page dump
2015-12-22 16:46:03 12d4 InnoDB: uncompressed page, stored checksum in field1 1169359801, calculated checksums for field1: crc32 4003191917, innodb 1169359801, none 3735928559, stored checksum in field2 4049981449, calculated checksums for field2: crc32 4003191917, innodb 587193584, none 3735928559, page LSN 128 4137924960, low 4 bytes of LSN at page end 4137853843, page number (if stored to page already) 0, space id (if created with >= MySQL-4.1.1 and stored already) 252
InnoDB: Page may be a file space header page
InnoDB: Database page corruption on disk or a failed
InnoDB: file read of page 0.
InnoDB: You may have to recover from a backup.
InnoDB: It is also possible that your operating
InnoDB: system has corrupted its own file cache
InnoDB: and rebooting your computer removes the
InnoDB: error.
InnoDB: If the corrupt page is an index page
InnoDB: you can also try to fix the corruption
InnoDB: by dumping, dropping, and reimporting
InnoDB: the corrupt table. You can use CHECK
InnoDB: TABLE to scan your table for corruption.
InnoDB: See also http://dev.mysql.com/doc/refman/5.6/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
InnoDB: Error: Unable to read tablespace 252 page no 0 into the buffer pool after 100 attempts
InnoDB: The most probable cause of this error may be that the table has been corrupted.
InnoDB: You can try to fix this problem by using innodb_force_recovery.
InnoDB: Please see reference manual for more details.
InnoDB: Aborting...
2015-12-22 16:46:03 12d4 InnoDB: Assertion failure in thread 4820 in file buf0buf.cc line 2641
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.6/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
16:46:03 UTC - mysqld got exception 0x80000003 ;
This could be because you hit a bug.
It is also possible that this binary
or one of the libraries it was linked against is corrupt,
improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help
diagnose the problem,
but since we have already crashed,
something is definitely wrong and this may
fail.
key_buffer_size=16777216
read_buffer_size=262144
max_used_connections=107
max_threads=151
thread_count=5
connection_count=5
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 133778 K bytes
of memory
Hope that's ok; if not, decrease some variables in the equation.
Thread pointer: 0x22020238
Attempting backtrace. You can use the following information to find out
where mysqld died.
If you see no messages after this, something went
terribly wrong...
50a500
mysqld.exe!my_thread_name()
74392d mysqld.exe!my_mb_ctype_mb()
5ecdb6
mysqld.exe!?my_aes_create_key##YAXPBEIPAEW4my_aes_opmode###Z()
61d611
mysqld.exe!?my_aes_create_key##YAXPBEIPAEW4my_aes_opmode###Z()
647350
mysqld.exe!?my_aes_create_key##YAXPBEIPAEW4my_aes_opmode###Z()
6492fa
mysqld.exe!?my_aes_create_key##YAXPBEIPAEW4my_aes_opmode###Z()
649383
mysqld.exe!?my_aes_create_key##YAXPBEIPAEW4my_aes_opmode###Z()
6493b3
mysqld.exe!?my_aes_create_key##YAXPBEIPAEW4my_aes_opmode###Z()
64945d
mysqld.exe!?my_aes_create_key##YAXPBEIPAEW4my_aes_opmode###Z()
6495cb
mysqld.exe!?my_aes_create_key##YAXPBEIPAEW4my_aes_opmode###Z()
5d48e3
mysqld.exe!?my_aes_create_key##YAXPBEIPAEW4my_aes_opmode###Z()
53f011
mysqld.exe!?my_aes_create_key##YAXPBEIPAEW4my_aes_opmode###Z()
2be48e
mysqld.exe!?ha_write_row#handler##QAEHPAE#Z()
3d8d10
mysqld.exe!?write_record##YAHPAVTHD##PAUTABLE##PAVCOPY_INFO##2#Z()
3df599
mysqld.exe!?mysql_insert##YA_NPAVTHD##PAUTABLE_LIST##AAV?$List#VItem####AAV?$List#V?$List#VItem######22W4enum_duplicates##_N#Z()
2ecdf5
mysqld.exe!?mysql_execute_command##YAHPAVTHD###Z()
2ef81e
mysqld.exe!?mysql_parse##YAXPAVTHD##PADIPAVParser_state###Z()
2f06f8
mysqld.exe!?dispatch_command##YA_NW4enum_server_command##PAVTHD##PADI#Z()
2f135a
mysqld.exe!?do_command##YA_NPAVTHD###Z()
364e59 mysqld.exe!?do_handle_one_connection##YAXPAVTHD###Z()
364efd
mysqld.exe!handle_one_connection()
6bb8cb mysqld.exe!?my_aes_create_key##YAXPBEIPAEW4my_aes_opmode###Z()
510336
mysqld.exe!win_pthread_mutex_trylock()
746c00 mysqld.exe!my_mb_ctype_mb()
746c8a
mysqld.exe!my_mb_ctype_mb()
7728338a kernel32.dll!BaseThreadInitThunk()
77c297f2
ntdll.dll!RtlInitializeExceptionChain()
77c297c5
ntdll.dll!RtlInitializeExceptionChain()
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (21e3387c): INSERT INTO 'WPM'(
`Pos`,
`FileMod`,
`Duration`) VALUES (
'IWM',
'2015-12-14 07:47:47 ',
0)Connection ID (thread ID): 3722
Status: NOT_KILLED
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
2015-12-23 08:21:58 4920
[Note] Plugin 'FEDERATED' is disabled.
2015-12-23 08:21:58 10c4 InnoDB: Warning: Using innodb_additional_mem_pool_size is DEPRECATED. This option may be removed in future releases, together with the option innodb_use_sys_malloc and with the InnoDB's internal memory allocator.
2015-12-23 08:21:58 4920 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-12-23 08:21:58 4920 [Note] InnoDB: The InnoDB memory heap is disabled
2015-12-23 08:21:58 4920 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2015-12-23 08:21:58 4920 [Note] InnoDB: Memory barrier is not used
2015-12-23 08:21:58 4920 [Note] InnoDB: Compressed tables use zlib 1.2.3
2015-12-23 08:21:58 4920 [Note] InnoDB: Not using CPU crc32 instructions
2015-12-23 08:21:58 4920 [Note] InnoDB: Initializing buffer pool, size = 16.0M
2015-12-23 08:21:58 4920 [Note] InnoDB: Completed initialization of buffer pool
2015-12-23 08:21:58 4920 [Note] InnoDB: Highest supported file format is Barracuda.
2015-12-23 08:21:58 4920 [Note] InnoDB: Log scan progressed past the checkpoint lsn 553893690098
2015-12-23 08:21:58 4920 [Note] InnoDB: Database was not shutdown normally!
2015-12-23 08:21:58 4920 [Note] InnoDB: Starting crash recovery.
2015-12-23 08:21:58 4920 [Note] InnoDB: Reading tablespace information from the .ibd files...
2015-12-23 08:21:59 4920 [Note] InnoDB: Restoring possible half-written data pages
2015-12-23 08:21:59 4920 [Note] InnoDB: from the doublewrite buffer...
InnoDB: Doing recovery: scanned up to log sequence number 553893828751
InnoDB: 1 transaction(s) which must be rolled back or cleaned up
InnoDB: in total 151 row operations to undo
InnoDB: Trx id counter is 152858880
2015-12-23 08:22:00 4920 [Note] InnoDB: Starting an apply batch of log records to the database...
InnoDB: Progress in percent: 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 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
InnoDB: Apply batch completed
2015-12-23 08:22:00 4920 [Note] InnoDB: 128 rollback segment(s) are active.
InnoDB: Starting in background the rollback of uncommitted transactions
2015-12-23 08:22:00 2c4 InnoDB: Rolling back trx with id 152858375, 151 rows to undo
2015-12-23 08:22:00 4920 [Note] InnoDB: Waiting for purge to start
2015-12-23 08:22:00 4920 [Note] InnoDB: Rollback of trx with id 152858375 completed
2015-12-23 08:22:00 2c4 InnoDB: Rollback of non-prepared transactions completed
2015-12-23 08:22:00 4920 [Note] InnoDB: 5.6.20 started; log sequence number 553893828751
2015-12-23 08:22:00 4920 [Note] Server hostname (bind-address): '*'; port: 3306
2015-12-23 08:22:00 4920 [Note] IPv6 is available.
2015-12-23 08:22:00 4920 [Note] - '::' resolves to '::';
2015-12-23 08:22:00 4920 [Note] Server socket created on IP: '::'.
2015-12-23 08:22:00 4920 [Note] Event Scheduler: Loaded 11 events
2015-12-23 08:22:00 4920 [Note] c:\xampp\mysql\bin\mysqld.exe: ready for connections.
Version: '5.6.20' socket: '' port: 3306 MySQL Community Server (GPL)
2015-12-23 08:24:07 5736 [Note] Plugin 'FEDERATED' is disabled.
2015-12-23 08:24:07 fc8 InnoDB: Warning: Using innodb_additional_mem_pool_size is DEPRECATED. This option may be removed in future releases, together with the option innodb_use_sys_malloc and with the InnoDB's internal memory allocator.
2015-12-23 08:24:07 5736 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-12-23 08:24:07 5736 [Note] InnoDB: The InnoDB memory heap is disabled
2015-12-23 08:24:07 5736 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2015-12-23 08:24:07 5736 [Note] InnoDB: Memory barrier is not used
2015-12-23 08:24:07 5736 [Note] InnoDB: Compressed tables use zlib 1.2.3
2015-12-23 08:24:07 5736 [Note] InnoDB: Not using CPU crc32 instructions
2015-12-23 08:24:07 5736 [Note] InnoDB: Initializing buffer pool, size = 16.0M
2015-12-23 08:24:07 5736 [Note] InnoDB: Completed initialization of buffer pool
2015-12-23 08:24:07 5736 [Note] InnoDB: Highest supported file format is Barracuda.
2015-12-23 08:24:07 5736 [Note] InnoDB: Log scan progressed past the checkpoint lsn 553896050587
2015-12-23 08:24:07 5736 [Note] InnoDB: Database was not shutdown normally!
2015-12-23 08:24:07 5736 [Note] InnoDB: Starting crash recovery.
2015-12-23 08:24:07 5736 [Note] InnoDB: Reading tablespace information from the .ibd files...
2015-12-23 08:24:07 5736 [Note] InnoDB: Restoring possible half-written data pages
2015-12-23 08:24:07 5736 [Note] InnoDB: from the doublewrite buffer...
InnoDB: Doing recovery: scanned up to log sequence number 553896774958
2015-12-23 08:24:07 5736 [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 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 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
InnoDB: Apply batch completed
//////////////////////////////////*********************
Error on 2016-01-08
********************////////////////////////
2016-01-08 00:00:14 1584 InnoDB: uncompressed page, stored checksum in field1 1299653197, calculated checksums for field1: crc32 90466284, innodb 1299653197, none 3735928559, stored checksum in field2 341870525, calculated checksums for field2: crc32 90466284, innodb 3590763946, none 3735928559, page LSN 129 3920058837, low 4 bytes of LSN at page end 3920015931, page number (if stored to page already) 75791, space id (if created with >= MySQL-4.1.1 and stored already) 0
InnoDB: Page may be an update undo log page
InnoDB: Database page corruption on disk or a failed
InnoDB: file read of page 75791.
InnoDB: You may have to recover from a backup.
InnoDB: It is also possible that your operating
InnoDB: system has corrupted its own file cache
InnoDB: and rebooting your computer removes the
InnoDB: error.
InnoDB: If the corrupt page is an index page
InnoDB: you can also try to fix the corruption
InnoDB: by dumping, dropping, and reimporting
InnoDB: the corrupt table. You can use CHECK
InnoDB: TABLE to scan your table for corruption.
InnoDB: See also http://dev.mysql.com/doc/refman/5.6/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
InnoDB: Ending processing because of a corrupt database page.
2016-01-08 00:00:14 1584 InnoDB: Assertion failure in thread 5508 in file buf0buf.cc line 4195
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.6/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
00:00:14 UTC - mysqld got exception 0x80000003 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed,
something is definitely wrong and this may fail.
key_buffer_size=16777216
read_buffer_size=262144
max_used_connections=113
max_threads=151
thread_count=5
connection_count=4
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 133778 K bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
Thread pointer: 0x0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
116a500 mysqld.exe!my_thread_name()
13a392d mysqld.exe!my_mb_ctype_mb()
12c7aa2 mysqld.exe!?my_aes_create_key##YAXPBEIPAEW4my_aes_opmode###Z()
12c82ad mysqld.exe!?my_aes_create_key##YAXPBEIPAEW4my_aes_opmode###Z()
1225a72 mysqld.exe!?my_aes_create_key##YAXPBEIPAEW4my_aes_opmode###Z()
11d423b mysqld.exe!?my_aes_create_key##YAXPBEIPAEW4my_aes_opmode###Z()
11d4694 mysqld.exe!?my_aes_create_key##YAXPBEIPAEW4my_aes_opmode###Z()
11d548a mysqld.exe!?my_aes_create_key##YAXPBEIPAEW4my_aes_opmode###Z()
11b147d mysqld.exe!?my_aes_create_key##YAXPBEIPAEW4my_aes_opmode###Z()
11b167d mysqld.exe!?my_aes_create_key##YAXPBEIPAEW4my_aes_opmode###Z()
7728338a kernel32.dll!BaseThreadInitThunk()
77c297f2 ntdll.dll!RtlInitializeExceptionChain()
77c297c5 ntdll.dll!RtlInitializeExceptionChain()
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
InnoDB: Warning: a long semaphore wait:
--Thread 6764 has waited at trx0undo.cc line 1778 for 29770.00 seconds the semaphore:
Mutex at 1B4F60EC created file trx0rseg.cc line 196, lock var 1
waiters flag 1
InnoDB: ###### Starts InnoDB Monitor for 30 secs to print diagnostic info:
InnoDB: Pending preads 0, pwrites 0
Here is the mysql.ini settings file (If this helps)
# The MySQL server
[mysqld]
port= 3306
socket = "C:/xampp/mysql/mysql.sock"
basedir = "C:/xampp/mysql"
tmpdir = "C:/xampp/tmp"
datadir = "C:/xampp/mysql/data"
pid_file = "mysql.pid"
# enable-named-pipe
key_buffer = 16M
max_allowed_packet = 1M
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
log_error = "mysql_error.log"
# Change here for bind listening
# bind-address="127.0.0.1"
# bind-address = ::1 # for ipv6
# Where do all the plugins live
plugin_dir = "C:/xampp/mysql/lib/plugin/"
# Don't listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (via the "enable-named-pipe" option) will render mysqld useless!
#
# commented in by lampp security
#skip-networking
skip-federated
# Replication Master Server (default)
# binary logging is required for replication
# log-bin deactivated by default since XAMPP 1.4.11
#log-bin=mysql-bin
# required unique id between 1 and 2^32 - 1
# defaults to 1 if master-host is not set
# but will not function as a master if omitted
server-id = 1
# Replication Slave (comment out master section to use this)
#
# To configure this host as a replication slave, you can choose between
# two methods :
#
# 1) Use the CHANGE MASTER TO command (fully described in our manual) -
# the syntax is:
#
# CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>,
# MASTER_USER=<user>, MASTER_PASSWORD=<password> ;
#
# where you replace <host>, <user>, <password> by quoted strings and
# <port> by the master's port number (3306 by default).
#
# Example:
#
# CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306,
# MASTER_USER='joe', MASTER_PASSWORD='secret';
#
# OR
#
# 2) Set the variables below. However, in case you choose this method, then
# start replication for the first time (even unsuccessfully, for example
# if you mistyped the password in master-password and the slave fails to
# connect), the slave will create a master.info file, and any later
# change in this file to the variables' values below will be ignored and
# overridden by the content of the master.info file, unless you shutdown
# the slave server, delete master.info and restart the slaver server.
# For that reason, you may want to leave the lines below untouched
# (commented) and instead use CHANGE MASTER TO (see above)
#
# required unique id between 2 and 2^32 - 1
# (and different from the master)
# defaults to 2 if master-host is set
# but will not function as a slave if omitted
#server-id = 2
#
# The replication master for this slave - required
#master-host = <hostname>
#
# The username the slave will use for authentication when connecting
# to the master - required
#master-user = <username>
#
# The password the slave will authenticate with when connecting to
# the master - required
#master-password = <password>
#
# The port the master is listening on.
# optional - defaults to 3306
#master-port = <port>
#
# binary logging - not required for slaves, but recommended
#log-bin=mysql-bin
# Point the following paths to different dedicated disks
#tmpdir = "C:/xampp/tmp"
#log-update = /path-to-dedicated-directory/hostname
# Uncomment the following if you are using BDB tables
#bdb_cache_size = 4M
#bdb_max_lock = 10000
# Comment the following if you are using InnoDB tables
#skip-innodb
innodb_data_home_dir = "C:/xampp/mysql/data"
innodb_data_file_path = ibdata1:10M:autoextend
innodb_log_group_home_dir = "C:/xampp/mysql/data"
#innodb_log_arch_dir = "C:/xampp/mysql/data"
## You can set .._buffer_pool_size up to 50 - 80 %
## of RAM but beware of setting memory usage too high
innodb_buffer_pool_size = 16M
innodb_additional_mem_pool_size = 2M
## Set .._log_file_size to 25 % of buffer pool size
innodb_log_file_size = 5M
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 50
## UTF 8 Settings
#init-connect=\'SET NAMES utf8\'
#collation_server=utf8_unicode_ci
#character_set_server=utf8
#skip-character-set-client-handshake
#character_sets-dir="C:/xampp/mysql/share/charsets"
[mysqldump]
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates
[isamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M
[myisamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeout
I simply have no idea what to do, I have no experience in the technical side to troubleshooting Mysql. I have looked on the MYsql site, are apparently error code 995 is a known bug, it was meant to be fixed, but I read that it never got pushed into the build.
If you need any more info please ask!

InnoDB deliberately crashes MySQL if it reads a page from "disk" (might come from RAM though if the relevant blocks are in OS cache) and the checksum mismatches with the one in the page header. This is what's happening to you.
Reasons could be:
If you're not using ECC ram you might just have some corrupted data in OS cache. Rebooting the server will clear the cache and you can get some ECC ram to prevent it happening. (less likely)
On disk corruption (more likely):
If you're lucky the corruption is on index pages and you can fully recover by doing a innodb_recovery (http://dev.mysql.com/doc/refman/5.6/en/forcing-innodb-recovery.html)
If the corruption is on data page you most certainly will lose data but you still should be able to recover most of the information using the same method.
In such cases I would just restore from backup if that's possible. The other error you pasted also indicates system level I/O issues so I would look into it soon before it crashes completely.

I believe some pages in Innodb tablespace got corrupted..
First backup your DB!
First suggestion would be to run check table using this command:
mysqlcheck -A --auto-repair
Reference: Here
Add the following line below the mysqld section in the mysql config file (my.ini) and restart both the apache and mysql service afterwards.
innodb_force_recovery = 1
For your information: read this
Note: Innodb becomes read only for data operations when running in innodb_force_recovery mode
If this is not working, my second suggestion would be to decrease the innodb_buffer_pool_size and convert some "heavey loading" tables into MyISAM:
ALTER TABLE table_name ENGINE=MYISAM
Although you increased the specs of your machine, due to high usage of your DB table can still cause a problem.
(Please update me and which you good luck!)

Related

MySQL not starting on AMPPS 3.8 on iMac/OS X

I am running AMPPS 3.8 on OS X (Mojave v10.14)
After my HD unexpectedly died, I replaced the HD and reloaded my latest backup. MySQL does not load/run in AMMPPS :( My expectation was that the AMPPS would work as expected (Apache/php 7.1/MySQL would all run per usual).
In attempting to resolve the issue I have read through the AMPPS wiki, youtube, googling, and reading similar threads on stackOverflow, I attempted the following steps as listed below. MySQL did not turn on when i clicked on the on/off butto, nor did clicking the restart cause MySQL to start.
WHAT I ATTEMPTED:
1. Clicked on config icon: This now opens 'my.cnf', not 'my.ini'
2. added instruction line to my.cnf: innodb_force_recovery = 1
3. Save configuration
4. Clicked on/off switch (did nothing/Did not click/did not work)
5. Clicked restart icon
My MySql did not start.
OBSERVATION: when you click on the configuration tool (tool icon), it opens the file 'my.cnf' instead of 'my.ini'
mysql.err log
2020-02-24 10:38:28 1417 [Warning] You need to use --log-bin to make --binlog-format work.
2020-02-24 10:38:28 1417 [Note] Plugin 'FEDERATED' is disabled.
2020-02-24 10:38:28 1417 [Note] InnoDB: Using atomics to ref count buffer pool pages
2020-02-24 10:38:28 1417 [Note] InnoDB: The InnoDB memory heap is disabled
2020-02-24 10:38:28 1417 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2020-02-24 10:38:28 1417 [Note] InnoDB: Memory barrier is not used
2020-02-24 10:38:28 1417 [Note] InnoDB: Compressed tables use zlib 1.2.3
2020-02-24 10:38:28 1417 [Note] InnoDB: Not using CPU crc32 instructions
2020-02-24 10:38:28 1417 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2020-02-24 10:38:28 1417 [Note] InnoDB: Completed initialization of buffer pool
2020-02-24 10:38:28 1417 [Note] InnoDB: Highest supported file format is Barracuda.
2020-02-24 10:38:28 1417 [Note] InnoDB: 128 rollback segment(s) are active.
2020-02-24 10:38:28 1417 [Note] InnoDB: Waiting for purge to start
InnoDB: Error: tablespace id is 1140 in the data dictionary
InnoDB: but in file ./test#002emarvelchampionsuniverse/ma_images.ibd it is 1155!
2020-02-24 10:38:28 b088c000 InnoDB: Assertion failure in thread 2961752064 in file fil0fil.cc line 797
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.6/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
18:38:28 UTC - mysqld got signal 6 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed,
something is definitely wrong and this may fail.
key_buffer_size=16777216
read_buffer_size=262144
max_used_connections=0
max_threads=151
thread_count=0
connection_count=0
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 133617 K bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
Thread pointer: 0x0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 0 thread_stack 0x30000
0 mysqld 0x00309dbe my_print_stacktrace + 46
1 mysqld 0x00148c35 handle_fatal_signal + 758
2 libsystem_platform.dylib 0xa7cd7b6e _sigtramp + 46
3 ??? 0xffffffff 0x0 + 4294967295
4 libsystem_c.dylib 0xa7b9162b abort + 133
5 mysqld 0x00377605 _ZL18fil_node_open_fileP10fil_node_tP12fil_system_tP11fil_space_t + 100
6 mysqld 0x003780ad _ZL23fil_node_prepare_for_ioP10fil_node_tP12fil_system_tP11fil_space_t + 147
7 mysqld 0x0037bea3 _Z6fil_iombmmmmmPvS_ + 513
8 mysqld 0x00354bf1 _ZL17buf_read_page_lowP7dberr_tbmmmmxm + 460
9 mysqld 0x00355134 _Z13buf_read_pagemmm + 88
10 mysqld 0x00346f06 _Z16buf_page_get_genmmmmP11buf_block_tmPKcmP5mtr_t + 488
11 mysqld 0x0033c88d _Z27btr_cur_search_to_nth_levelP12dict_index_tmPK8dtuple_tmmP9btr_cur_tmPKcmP5mtr_t + 1128
12 mysqld 0x0042100b _ZL17btr_pcur_open_lowP12dict_index_tmPK8dtuple_tmmP10btr_pcur_tPKcmP5mtr_t + 119
13 mysqld 0x0042117f _Z21row_search_on_row_refP10btr_pcur_tmPK12dict_table_tPK8dtuple_tP5mtr_t + 141
14 mysqld 0x0041f64c _ZL25row_purge_reposition_pcurmP12purge_node_tP5mtr_t + 116
15 mysqld 0x0041f73d _ZL34row_purge_remove_clust_if_poss_lowP12purge_node_tm + 194
16 mysqld 0x004203d3 _Z14row_purge_stepP9que_thr_t + 478
17 mysqld 0x003f9e0e _Z15que_run_threadsP9que_thr_t + 710
18 mysqld 0x00443413 _Z9trx_purgemmb + 2971
19 mysqld 0x00434bed _ZL12srv_do_purgemPm + 317
20 mysqld 0x00435759 srv_purge_coordinator_thread + 1055
21 libsystem_pthread.dylib 0xa7cdf63c _pthread_body + 137
22 libsystem_pthread.dylib 0xa7ce2833 _pthread_start + 82
23 libsystem_pthread.dylib 0xa7cde806 thread_start + 34
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
I am a barista who enjoys attempting to write apps for fun and to help keep my mind sharp with early on set Alzheimer's disease, at best I am a novice. I do this to exercise my mind in an attempt to hold on to as much as I can for as long as I can. I am hoping to get MySQL working again if only once to export my local db to preserve what I have done.
Thank you for any and all help.

Mysql Server Down frequently

below is a log of mysql
MYSQL shutdown frequent and i cant solve the problem
image file
logfile
2018-02-26T08:15:08.301271Z 591 [Warning] IP address '192.168.1.4' has been resolved to the host name '192.168.1.4', which resembles IPv4-address itself.
2018-02-26T08:15:08.395035Z 596 [Warning] IP address '192.168.1.4' has been resolved to the host name '192.168.1.4', which resembles IPv4-address itself.
2018-02-26T08:19:23.208784Z 0 [ERROR] InnoDB: Operating system error number 995 in a file operation.
2018-02-26T08:19:23.208784Z 0 [ERROR] InnoDB: The error means that the I/O operation has been aborted because of either a thread exit or an application request. Retry attempt is made.
2018-02-26 15:19:23 0x25b0 InnoDB: Assertion failure in thread 9648 in file fil0fil.cc line 5789
InnoDB: Failing assertion: err == DB_SUCCESS
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.7/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
08:19:23 UTC - mysqld got exception 0x80000003 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
Attempting to collect some information that could help diagnose the problem.
As this is a crash and something is definitely wrong, the information
collection process might fail.
key_buffer_size=8388608
read_buffer_size=65536
max_used_connections=48
max_threads=200
thread_count=7
connection_count=7
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 74620 K bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
Thread pointer: 0x0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
7f68cb05ea2 mysqld.exe!my_errno()
7f68cea9919 mysqld.exe!my_wildcmp_mb()
7f68cea8810 mysqld.exe!my_wildcmp_mb()
7f68cc05ac8 mysqld.exe!?reserve#?$vector#EV?$allocator#E#std###std##QEAAX_K#Z()
7f68cc2c49a mysqld.exe!?reserve#?$vector#EV?$allocator#E#std###std##QEAAX_K#Z()
7f68cbc4e94 mysqld.exe!?reserve#?$vector#EV?$allocator#E#std###std##QEAAX_K#Z()
7fefff81842 KERNEL32.DLL!BaseThreadInitThunk()
7ff012ac3f1 ntdll.dll!RtlUserThreadStart()
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
2018-02-26T08:19:36.819511Z 0 [Note] C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqld.exe (mysqld 5.7.11-log) starting as process 7620 ...
2018-02-26T08:19:36.835137Z 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2018-02-26T08:19:36.835137Z 0 [Note] InnoDB: Uses event mutexes
2018-02-26T08:19:36.835137Z 0 [Note] InnoDB: _mm_lfence() and _mm_sfence() are used for memory barrier
2018-02-26T08:19:36.835137Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2018-02-26T08:19:36.835137Z 0 [Note] InnoDB: Adjusting innodb_buffer_pool_instances from 8 to 1 since innodb_buffer_pool_size is less than 1024 MiB
2018-02-26T08:19:36.835137Z 0 [Note] InnoDB: Number of pools: 1
2018-02-26T08:19:36.835137Z 0 [Note] InnoDB: Not using CPU crc32 instructions
2018-02-26T08:19:36.897642Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2018-02-26T08:19:36.897642Z 0 [Note] InnoDB: Completed initialization of buffer pool
2018-02-26T08:19:36.944522Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2018-02-26T08:19:36.960149Z 0 [Note] InnoDB: Log scan progressed past the checkpoint lsn 100862484017
2018-02-26T08:19:36.960149Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 100862486308
2018-02-26T08:19:36.960149Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 100862486308
2018-02-26T08:19:36.975774Z 0 [Note] InnoDB: Database was not shutdown normally!
2018-02-26T08:19:36.975774Z 0 [Note] InnoDB: Starting crash recovery.
2018-02-26T08:19:37.444572Z 0 [Note] InnoDB: Starting an apply batch of log records to the database...
InnoDB: Progress in percent: 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 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
2018-02-26T08:19:37.975874Z 0 [Note] InnoDB: Apply batch completed
2018-02-26T08:19:39.585408Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2018-02-26T08:19:39.585408Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2018-02-26T08:19:39.585408Z 0 [Note] InnoDB: Setting file '.\ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2018-02-26T08:19:40.101086Z 0 [Note] InnoDB: File '.\ibtmp1' size is now 12 MB.
2018-02-26T08:19:40.101086Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2018-02-26T08:19:40.101086Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2018-02-26T08:19:40.101086Z 0 [Note] InnoDB: Waiting for purge to start
2018-02-26T08:19:40.163591Z 0 [Note] InnoDB: 5.7.11 started; log sequence number 100862486308
2018-02-26T08:19:40.163591Z 0 [Note] InnoDB: Loading buffer pool(s) from C:\ProgramData\MySQL\MySQL Server 5.7\Data\ib_buffer_pool
2018-02-26T08:19:40.163591Z 0 [Note] Plugin 'FEDERATED' is disabled.
2018-02-26T08:19:40.491749Z 0 [Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key
2018-02-26T08:19:40.491749Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
2018-02-26T08:19:40.491749Z 0 [Note] IPv6 is available.
2018-02-26T08:19:40.491749Z 0 [Note] - '::' resolves to '::';
2018-02-26T08:19:40.491749Z 0 [Note] Server socket created on IP: '::'.
2018-02-26T08:19:40.757400Z 0 [Note] Event Scheduler: Loaded 0 events
2018-02-26T08:19:40.757400Z 0 [Note] C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqld.exe: ready for connections.
Version: '5.7.11-log' socket: '' port: 3306 MySQL Community Server (GPL)
2018-02-26T08:19:45.164087Z 0 [Note] InnoDB: Buffer pool(s) load completed at 180226 15:19:45
Suggestions for your my.cnf/ini [mysqld] section
Every x Connection listed in MySQLCalculator.com must be REMOVED from your my.cnf-ini to allow DEFAULTS to serve you.
thread_cache_size=100 # from 10 REFMAN v5.7 5.1.5 for CAP of 100 suggested
innodb_io_capacity=800 # from 200 to enable higher capacity
lock_wait_timeout=300 # from 31536000, who wants to wait ONE Year?
eq_range_index_dive_limit=20 $ from 200 not found in 20, is missing
expire_logs_days=5 # from 0 so you have limited historical logs
key_buffer_size=1M # from 8M you had key_blocks_used of 2
innodb_buffer_pool_instances=8 # from 1 to avoid mutex contention
innodb_buffer_pool_size=8G # from 128M until you need more for data volume
innodb_log_buffer_size=8M # from 134M - can not be > innodb_log_file_size
innodb_lru_scan_depth=128 # from 1024 see REFMAN for why
innodb_page_cleaners=64 # from 1 will be limited to be = innodb_buffer_pool_instances
innodb_print_all_deadlocks=ON # from OFF - check error log DAILY
innodb_read_io_threads=64 # from 4 see dba.stackexchange.com Q 5666 9/12/11
innodb_thread_concurrency=0 # in 5666 Rolando explains these 3 values
innodb_io_threads=64 # from 4 and how the combination enables multi-core
innodb_stats_sample_pages=32 # from 8 for more accurate cardinality
#max_allowed_packet=1G # leading # to disable for DEFAULT size
if you NEED larger size for LOCAL INFILE, in your SESSION,
SET #max_allowed_packet=nnnnnnnnnnnn up to 1G which is the MAX
max_seeks_for_key=32 # from a huge number, do not waste CPU past 32
max_write_lock_count=16 # from a huge number, allow RD after nn LOCKS
wait_timeout=3600 # from 8 hours, not touched in 1 HR release rscrs, log in again
Good luck.
Suggestions for your my.cnf/ini [mysqld] section
#sort_buffer_size=~256K # lead to allow DEFAULT to work for you
max_connections=100 # from 200 since max_used_connection were 48 since start
derived from your original posted information of 2/26/2018.
These changes will lower RAM requirements and we do not know how much RAM you have on your server.

MySQL 5.6 not starting (migrate MAMP 2 to MAMP 4)

The old and the new MAMP: They don't boot MySQL server. Before the upgrade to MAMP 4, my MySQL server was working properly on OS X 10.11.6 El Capitan.
Now with MAMP is not possible to start the MySQL server (and migrate my old DB).
Note: "Tools > upgrade MySQL databases" is not accessible in the menu bar (remains gray) but no problem with Apache and PHP.
My chmod for all files from /Applications/MAMP/db/ is:
RW admin (group)
RW system
RW _mysql
RW _mysql (group)
RW everyone
and chmod for all files from /Applications/MAMP/tmp/mysql is:
RW admin (group)
RW system
RW everyone
MySQL last log error:
161007 12:20:26 mysqld_safe Starting mysqld daemon with databases from /Applications/MAMP/db/mysql56
2016-10-07 12:20:27 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-10-07 12:20:27 0 [Note] /Applications/MAMP/Library/bin/mysqld (mysqld 5.6.28) starting as process 16615 ...
2016-10-07 12:20:27 16615 [Warning] Setting lower_case_table_names=2 because file system for /Applications/MAMP/db/mysql56/ is case insensitive
2016-10-07 12:20:27 16615 [Note] Plugin 'FEDERATED' is disabled.
2016-10-07 12:20:27 16615 [Note] InnoDB: Using atomics to ref count buffer pool pages
2016-10-07 12:20:27 16615 [Note] InnoDB: The InnoDB memory heap is disabled
2016-10-07 12:20:27 16615 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-10-07 12:20:27 16615 [Note] InnoDB: Memory barrier is not used
2016-10-07 12:20:27 16615 [Note] InnoDB: Compressed tables use zlib 1.2.8
2016-10-07 12:20:27 16615 [Note] InnoDB: Using CPU crc32 instructions
2016-10-07 12:20:27 16615 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2016-10-07 12:20:27 16615 [Note] InnoDB: Completed initialization of buffer pool
2016-10-07 12:20:27 16615 [Note] InnoDB: Highest supported file format is Barracuda.
2016-10-07 12:20:27 16615 [Note] InnoDB: Log scan progressed past the checkpoint lsn 8276492
2016-10-07 12:20:27 16615 [Note] InnoDB: Database was not shutdown normally!
2016-10-07 12:20:27 16615 [Note] InnoDB: Starting crash recovery.
2016-10-07 12:20:27 16615 [Note] InnoDB: Reading tablespace information from the .ibd files...
2016-10-07 12:20:27 16615 [Note] InnoDB: Restoring possible half-written data pages
2016-10-07 12:20:27 16615 [Note] InnoDB: from the doublewrite buffer...
InnoDB: Doing recovery: scanned up to log sequence number 8280376
2016-10-07 12:20:27 16615 [Note] InnoDB: Starting an apply batch of log records to the database...
InnoDB: Progress in percent: 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
2016-10-07 12:20:27 16615 [Note] InnoDB: 128 rollback segment(s) are active.
2016-10-07 12:20:27 16615 [Note] InnoDB: Waiting for purge to start
2016-10-07 12:20:27 7000007ab000 InnoDB: Assertion failure in thread 123145310351360 in file dict0dict.cc line 3464
InnoDB: Failing assertion: for_table || ref_table
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.6/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
10:20:27 UTC - mysqld got signal 6 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed,
something is definitely wrong and this may fail.
key_buffer_size=8388608
read_buffer_size=131072
max_used_connections=0
max_threads=151
thread_count=0
connection_count=0
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 68101 K bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
Thread pointer: 0x0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 0 thread_stack 0x40000
0 mysqld 0x0000000106f73688 my_print_stacktrace + 72
1 mysqld 0x0000000106c3a9e8 handle_fatal_signal + 952
2 libsystem_platform.dylib 0x00007fff9fa7d52a _sigtramp + 26
3 ??? 0x020061d7b33d5471 0x0 + 144222767128859761
4 libsystem_c.dylib 0x00007fff9f4f66df abort + 129
5 mysqld 0x000000010700ba56 _Z25dict_foreign_add_to_cacheP14dict_foreign_tPPKcb17dict_err_ignore_t + 230
6 mysqld 0x0000000107026dba _ZL17dict_load_foreignPKcPS0_bb17dict_err_ignore_t + 1674
7 mysqld 0x000000010702601b _Z18dict_load_foreignsPKcPS0_bb17dict_err_ignore_t + 1115
8 mysqld 0x0000000107024996 _Z15dict_load_tablePKcm17dict_err_ignore_t + 2246
9 mysqld 0x0000000107026441 _Z21dict_load_table_on_idy17dict_err_ignore_t + 689
10 mysqld 0x0000000107004098 _ZL25dict_table_open_on_id_lowy17dict_err_ignore_t + 184
11 mysqld 0x0000000107003ee3 _Z21dict_table_open_on_idym15dict_table_op_t + 99
12 mysqld 0x000000010717dc75 _ZL24row_purge_parse_undo_recP12purge_node_tPhPbP9que_thr_t + 229
13 mysqld 0x000000010717d88f _ZL9row_purgeP12purge_node_tPhP9que_thr_t + 63
14 mysqld 0x000000010717d741 _Z14row_purge_stepP9que_thr_t + 305
15 mysqld 0x0000000107133d91 _ZL12que_thr_stepP9que_thr_t + 913
16 mysqld 0x00000001071334eb _ZL19que_run_threads_lowP9que_thr_t + 123
17 mysqld 0x00000001071332ee _Z15que_run_threadsP9que_thr_t + 110
18 mysqld 0x00000001071bc15a _Z9trx_purgemmb + 778
19 mysqld 0x00000001071aa673 _ZL12srv_do_purgemPm + 579
20 mysqld 0x00000001071a9be7 srv_purge_coordinator_thread + 679
21 libsystem_pthread.dylib 0x00007fff9328e99d _pthread_body + 131
22 libsystem_pthread.dylib 0x00007fff9328e91a _pthread_body + 0
23 libsystem_pthread.dylib 0x00007fff9328c351 thread_start + 13
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
161007 12:20:27 mysqld_safe mysqld from pid file /Applications/MAMP/tmp/mysql/mysql.pid ended
I experienced the exact same problem and this is the only location (as of 10 Feb 2017) where I have found it reported as a problem.
If you don't need the content of the databases from MAMP 2, then this is easy:
Verify that MySQL is not running (via MAMP GUI and either Activity Monitor or Terminal process list)
Navigate to /Applications/MAMP/db/mysql56
Remove these three files: ib_logfile0, ib_logfile1, and ibdata1
Restart MySQL Server in MAMP
I found this solution here: http://www.randombugs.com/linux/crash-innodb-table.html. Note that the ibdata file is where InnoDB stores the data from your tables by default (https://serverfault.com/questions/487159/what-is-the-ibdata1-file-in-my-var-lib-mysql-directory) so it would be good to back-up these files before removing them; just in case something doesn't work out, you can restore back to your non-working configuration.
On the other hand, if you need the content of your MAMP 2 databases, then you will have needed to have completed a backup of them in the older/working version, preferably a MySQL dump so that restoration is as easy as copy/paste. Fortunately, I had a backup so in addition to deleting the "ib..." files listed above, I also deleted the directories of the databases that I intended to restore so that I could begin a restore with "CREATE DATABASE...".
I don't know whether this is a bug with MAMP, MySQL, OSX, but this is the solution that worked for me. I was able to restore the databases that I cared about and just didn't worry about losing the others for which I didn't have backed up.
Technical Data:
Old MAMP Version 2.1.2
Old MySQL Version 4.0.10.14
New MAMP Version 4.1.1
New MySQL Version 5.6.35
Mac OS 10.12.3

MariaDB 10.0.16 crash during import of MySQL 5.1.70 dump

I have a small MySQL 5.1.70 InnoDB database: 4 tables; ~3K, ~23K, ~500K, ~600K rows. This runs on OpenBSD 5.4.
I'm in the process of upgrading to OpenBSD 5.7 which switches to MariaDB 10.0.16 (which AFAIK back-ports MySQL 5.6 features). To this end I built a little staging OpenBSD 5.7/MariaDB server so that I can test the upgrade. I've recreated the db schema to match the prod one and ran mysql_upgrade --force just to be safe.
Now i'd like to fill it with prod data. I dumped the data with:
$ mysqldump -u root -p --single-transaction --no-create-info \
--skip-add-drop-table --skip-extended-insert mydb > data_dump.sql
$ du -h data_dump.sql
116M data_dump.sql
The dump contains text/numbers, no blobs or binaries.
The problem is that MariaDB keeps aborting randomly while importing the first table in the dump, which is just ~23K rows.
staging $ df -h
Filesystem Size Used Avail Capacity Mounted on
/dev/wd0a 7.2G 3.5G 3.3G 51% /
staging $ mysql -u root -p -D mydb < data_dump.sql
Enter password:
ERROR 2013 (HY000) at line 8039: Lost connection to MySQL server during query
The line where it crashes is a normal INSERT no different from thousands before that one. In fact repeating the import again (after truncating tables and ensuring server starts ok) will NOT crash at the same line. I've seen it crash after 4000 rows, for example, same my.cnf. So I ruled out the bad data hypothesis.
The error log shows the following (from server startup to crash):
160211 12:07:05 mysqld_safe Starting mysqld daemon with databases from /var/mysql
160211 12:07:06 [Note] InnoDB: Using mutexes to ref count buffer pool pages
160211 12:07:06 [Note] InnoDB: The InnoDB memory heap is disabled
160211 12:07:06 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
160211 12:07:06 [Note] InnoDB: GCC builtin __sync_synchronize() is used for memory barrier
160211 12:07:06 [Note] InnoDB: Compressed tables use zlib 1.2.3
160211 12:07:06 [Note] InnoDB: Not using CPU crc32 instructions
160211 12:07:06 [Note] InnoDB: Initializing buffer pool, size = 128.0M
160211 12:07:06 [Note] InnoDB: Completed initialization of buffer pool
160211 12:07:06 [Note] InnoDB: Setting log file /var/mysql/ib_logfile101 size to 32 MB
160211 12:07:09 [Note] InnoDB: Setting log file /var/mysql/ib_logfile1 size to 32 MB
160211 12:07:11 [Note] InnoDB: Renaming log file /var/mysql/ib_logfile101 to /var/mysql/ib_logfile0
160211 12:07:11 [Warning] InnoDB: New log files created, LSN=27985430
160211 12:07:11 [Note] InnoDB: Highest supported file format is Barracuda.
160211 12:07:11 [Note] InnoDB: 128 rollback segment(s) are active.
160211 12:07:12 [Note] InnoDB: Waiting for purge to start
160211 12:07:12 [Note] InnoDB: Percona XtraDB (http://www.percona.com) 5.6.22-71.0 started; log sequence number 27985932
160211 12:07:12 [Note] Server socket created on IP: '127.0.0.1'.
160211 12:07:12 [Note] Event Scheduler: Loaded 0 events
160211 12:07:12 [Note] /usr/local/libexec/mysqld: ready for connections.
Version: '10.0.16-MariaDB-log' socket: '/var/run/mysql/mysql.sock' port: 3306 OpenBSD port: mariadb-server-10.0.16v0
2016-02-11 12:09:34 c10b6700 InnoDB: Assertion failure in thread 3238749952 in file trx0purge.cc line 695
InnoDB: Failing assertion: purge_sys->rseg->last_page_no != FIL_NULL
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.6/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
Abort trap
160211 12:09:34 mysqld_safe mysqld restarted
160211 12:09:34 [Note] InnoDB: Using mutexes to ref count buffer pool pages
160211 12:09:34 [Note] InnoDB: The InnoDB memory heap is disabled
160211 12:09:34 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
160211 12:09:34 [Note] InnoDB: GCC builtin __sync_synchronize() is used for memory barrier
160211 12:09:34 [Note] InnoDB: Compressed tables use zlib 1.2.3
160211 12:09:34 [Note] InnoDB: Not using CPU crc32 instructions
160211 12:09:34 [Note] InnoDB: Initializing buffer pool, size = 128.0M
160211 12:09:35 [Note] InnoDB: Completed initialization of buffer pool
160211 12:09:35 [Note] InnoDB: Highest supported file format is Barracuda.
160211 12:09:35 [Note] InnoDB: Log scan progressed past the checkpoint lsn 31818497
160211 12:09:35 [Note] InnoDB: Database was not shutdown normally!
160211 12:09:35 [Note] InnoDB: Starting crash recovery.
160211 12:09:35 [Note] InnoDB: Reading tablespace information from the .ibd files...
160211 12:09:35 [Note] InnoDB: Restoring possible half-written data pages
160211 12:09:35 [Note] InnoDB: from the doublewrite buffer...
InnoDB: Doing recovery: scanned up to log sequence number 32140062
160211 12:09:36 [Note] InnoDB: Starting an apply batch of log records to the database...
InnoDB: Progress in percent: 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
InnoDB: Last MySQL binlog file position 0 2314577, file name ./binlog.000079
160211 12:09:36 [Note] InnoDB: 128 rollback segment(s) are active.
160211 12:09:36 [Note] InnoDB: Waiting for purge to start
160211 12:09:36 [Note] InnoDB: Percona XtraDB (http://www.percona.com) 5.6.22-71.0 started; log sequence number 32140062
160211 12:09:37 [Note] Recovering after a crash using binlog
160211 12:09:37 [Note] Starting crash recovery...
160211 12:09:37 [Note] Crash recovery finished.
160211 12:09:37 [Note] Server socket created on IP: '127.0.0.1'.
160211 12:09:37 [Note] Event Scheduler: Loaded 0 events
160211 12:09:37 [Note] /usr/local/libexec/mysqld: ready for connections.
Version: '10.0.16-MariaDB-log' socket: '/var/run/mysql/mysql.sock' port: 3306 OpenBSD port: mariadb-server-10.0.16v0
I didn't have luck googling for the purge_sys->rseg->last_page_no != FIL_NULL failed assertion. Here's /etc/my.cnf file for MariaDB:
[client]
port = 3306
socket = /var/run/mysql/mysql.sock
[mysqld]
port = 3306
socket = /var/run/mysql/mysql.sock
datadir = /var/mysql
max_allowed_packet = 128M
table_open_cache = 64
sort_buffer_size = 128K
read_buffer_size = 512K
net_buffer_length = 64K
server-id = 1
general-log = 1
general_log_file = query.log
log-error = error.log
slow-query-log = 1
long_query_time = 2
slow_query_log_file = slow_queries.log
bind-address = 127.0.0.1
log-bin = binlog
binlog_format = mixed
max_binlog_size = 512M
key_buffer_size = 2M
read_rnd_buffer_size = 1M
innodb_data_home_dir = /var/mysql/
innodb_log_group_home_dir = /var/mysql/
innodb_data_file_path = ibdata1:10M:autoextend
innodb_buffer_pool_size = 128M
innodb_log_file_size = 32M
innodb_log_buffer_size = 16M
innodb_lock_wait_timeout = 50
innodb_max_dirty_pages_pct = 1
[mysqldump]
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash
[mysqlhotcopy]
interactive-timeout
Originally some of those params were set to lower values (still are on the prod MySQL) but the increase above had little success:
net_buffer_length was 2K
max_allowed_packet was 1M
innodb_buffer_pool_size was 64M
innodb_log_file_size was 5M
innodb_log_buffer_size was 8M
Also, increasing innodb_buffer_pool_size/innodb_log_file_size to 256M/64M seemed to post-pone the crash a little but didn't help significantly.
Short of breaking the import into small chunks I don't know what else to do. It seems to me this is a pretty small import file though. The staging server is an old iBook (500mhz ppc) with a non-SSD drive (3.3G free), but I did not notice any disk problems or high memory pressure (top reported 200+Mb free RAM) during the import.
What my.cnf params could cause this crash?
EDIT:
timeout info as requested:
MariaDB []> SHOW GLOBAL VARIABLES LIKE '%timeout';
+-----------------------------+----------+
| Variable_name | Value |
+-----------------------------+----------+
| connect_timeout | 10 |
| delayed_insert_timeout | 300 |
| innodb_flush_log_at_timeout | 1 |
| innodb_lock_wait_timeout | 50 |
| innodb_rollback_on_timeout | OFF |
| interactive_timeout | 28800 |
| lock_wait_timeout | 31536000 |
| net_read_timeout | 30 |
| net_write_timeout | 60 |
| slave_net_timeout | 3600 |
| thread_pool_idle_timeout | 60 |
| wait_timeout | 28800 |
+-----------------------------+----------+
It looks like this might be a bug, perhaps OpenBSD/PowerPC related. It has been reported to MariaDB developers here: http://mariadb.atlassian.net/browse/MDEV-9569

MySQL has gone away on large queries

I have a MySQL installed and running on a CentOS 6.6 and MySQL version 5.5.40 on RackSpace. I always run into this error when running heavy queries.
Here is the settings of my.cnf
[mysqld]
2 datadir=/mnt/data/mysql
3 tmpdir=/mnt/data/temp
4 socket=/var/lib/mysql/mysql.sock
5 bind-address=0.0.0.0
6 port=3306
7 wait_timeout=432000
8 max_allowed_packet=1G
9 max_connections=500
10 query-cache-size=0
11 query-cache-type=0
12 #query_cache_size=64M
13 #query_cache_limit=64M
14 key_buffer_size=1G
15 sort_buffer_size=16M
16 tmp_table_size=32M
17 max_heap_table_size=32M
18 read_buffer_size=512K
19 read_rnd_buffer_size=512K
20 thread_cache_size=50
21
22 innodb_buffer_pool_size=12G
23 innodb_buffer_pool_instance=2
24 innodb_read_io_threads=12
25 innodb_write_io_threads=12
26 innodb_io_capacity=300
27 innodb_log_file_size=128M
28 innodb_thread_concurrency=0
Here is the error log I've caught after the crash:
150820 13:46:26 mysqld_safe Number of processes running now: 0
150820 13:46:26 mysqld_safe mysqld restarted
150820 13:46:26 [Note] Plugin 'FEDERATED' is disabled.
150820 13:46:26 [Warning] Using unique option prefix innodb_buffer_pool_instance instead of innodb-buffer-pool-instances is deprecated and will be removed in a future release. Please use the full name instead.
150820 13:46:26 InnoDB: The InnoDB memory heap is disabled
150820 13:46:26 InnoDB: Mutexes and rw_locks use GCC atomic builtins
150820 13:46:26 InnoDB: Compressed tables use zlib 1.2.3
150820 13:46:26 InnoDB: Using Linux native AIO
150820 13:46:26 InnoDB: Initializing buffer pool, size = 12.0G
InnoDB: mmap(6593445888 bytes) failed; errno 12
150820 13:46:27 InnoDB: Completed initialization of buffer pool
150820 13:46:27 InnoDB: Fatal error: cannot allocate memory for the buffer pool
150820 13:46:27 [ERROR] Plugin 'InnoDB' init function returned error.
150820 13:46:27 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
150820 13:46:27 [ERROR] Unknown/unsupported storage engine: InnoDB
150820 13:46:27 [ERROR] Aborting
150820 13:46:27 [Note] /usr/libexec/mysqld: Shutdown complete
150820 13:46:27 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
EDIT:
RackSpace VM's specs are:
CPU: Intel(R) Xeon(R) CPU E5-2670 0 # 2.60GHz
RAM: 8GB
your server has only 8 GB RAM and you have assigned too much ram to mysql.
Even you need to change your configuration for many variables but first to comeout your issue do the below changes-
innodb_buffer_pool_instance=2 #comment it for the time being we can set it later.
innodb_buffer_pool_size=6G
key_buffer_size=20M #if your server is innodb but if you are also using myisam tables then keep as it is.
sort_buffer_size=2M # we can change later.
read_buffer_size=512K # comment it for time being.
read_rnd_buffer_size=512K #comment it for time being as used per session
tmp_table_size=1G #this can be reason of your problem so increase it.
max_heap_table_size=1G #this can be reason of your problem so increase it.
If possible decrease max_connections from 500 to 400 as each connection uses server resources.
Try and share the results.
In case it is useful, this is how I solve this problem. In my case the problem was caused by queries that were too large for the packets being sent to the server.
After running the following command against the server, the large queries process fine
SET GLOBAL max_allowed_packet=1073741824;