MySQL (MariaDB) will not restart after my.cnf change - mysql

I changed my.cnf to add the innodb_log_file_size setting and when attempting to the start the server it fails with the following in the error log:
[Note] InnoDB: Using mutexes to ref count buffer pool pages
[Note] InnoDB: The InnoDB memory heap is disabled
[Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
[Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
[Note] InnoDB: Compressed tables use zlib 1.2.7
[Note] InnoDB: Using Linux native AIO
[Note] InnoDB: Using SSE crc32 instructions
[Note] InnoDB: Initializing buffer pool, size = 128.0M
[Note] InnoDB: Completed initialization of buffer pool
[Note] InnoDB: Highest supported file format is Barracuda.
[Note] InnoDB: The log sequence number 10942739155 in ibdata file do not match the log sequence number 11517047974 in the ib_logfiles!
[Note] InnoDB: Restoring possible half-written data pages from the doublewrite buffer...
[ERROR] InnoDB: The page [page id: space=0, page number=7] in file ./ibdata1 cannot be decrypted.
[Note] InnoDB: However key management plugin or used key_version 1 is not found or used encryption algorithm or method does not match.
[ERROR] InnoDB: Ending processing because of a corrupt database page.
InnoDB: Assertion failure in thread 139948494317824 in file ha_innodb.cc line 21960
Below is what is in my.cnf:
[mysqld]
log-error=/var/lib/mysql/error-log.err
performance-schema=0
default-storage-engine=innodb
innodb_file_per_table=1
query-cache-type = 1
query-cache-size = 256M
local-infile=0
bind-address=127.0.0.1
innodb_log_file_size = 256M
plugin-load-add=file_key_management
file_key_management_filename=/path-to-key/secret.txt
file_key_management_encryption_algorithm=AES_CTR
innodb-encrypt-tables
innodb-encrypt-log
innodb-encryption-threads = 4
innodb-encrypt-tables=FORCE
innodb-tablespaces-encryption
max_allowed_packet=268435456
open_files_limit=10000
innodb_fast_shutdown is set to 1. Also, I deleted (renamed) both ib_logfile0 and ib_logfile1 before restarting. The database uses encryption at rest. Any ideas?
MariaDB version: 10.1.26

Related

Error in Starting the MySQL from XAMPP 3.2.1

I am using XAMPP on my windows machine for PHP and MySQL. Whenever I attempted to the start the MySQL server from the XAMPP Control Panel V3.2.1. Only Apache server is starting and MySQL stops with the following error.
Error: MySQL shutdown unexpectedly.
11:41:12 AM [mysql] This may be due to a blocked port, missing dependencies,
11:41:12 AM [mysql] improper privileges, a crash, or a shutdown by another method.
11:41:12 AM [mysql] Press the Logs button to view error logs and check
11:41:12 AM [mysql] the Windows Event Viewer for more clues
11:41:12 AM [mysql] If you need more help, copy and post this
11:41:12 AM [mysql] entire log window on the forums
Also when I checked my log. I found the following error
2017-05-15 11:48:08 bc8 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.
170515 11:48:08 [Note] InnoDB: Using mutexes to ref count buffer pool pages
170515 11:48:08 [Note] InnoDB: The InnoDB memory heap is disabled
170515 11:48:08 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
170515 11:48:08 [Note] InnoDB: Memory barrier is not used
170515 11:48:08 [Note] InnoDB: Compressed tables use zlib 1.2.3
170515 11:48:08 [Note] InnoDB: Not using CPU crc32 instructions
170515 11:48:08 [Note] InnoDB: Initializing buffer pool, size = 16.0M
170515 11:48:08 [Note] InnoDB: Completed initialization of buffer pool
170515 11:48:08 [Note] InnoDB: Highest supported file format is Barracuda.
170515 11:48:08 [Note] InnoDB: Log scan progressed past the checkpoint lsn 12638736
170515 11:48:08 [Note] InnoDB: Database was not shutdown normally!
170515 11:48:08 [Note] InnoDB: Starting crash recovery.
170515 11:48:08 [Note] InnoDB: Reading tablespace information from the .ibd files...
170515 11:48:08 [Note] InnoDB: Restoring possible half-written data pages
170515 11:48:08 [Note] InnoDB: from the doublewrite buffer...
InnoDB: Doing recovery: scanned up to log sequence number 12638756
170515 11:48:09 [Note] InnoDB: 128 rollback segment(s) are active.
170515 11:48:09 [Note] InnoDB: Waiting for purge to start
170515 11:48:09 [Note] InnoDB: Percona XtraDB (http://www.percona.com) 5.6.22-72.0 started; log sequence number 12638756
170515 11:48:09 [Note] Plugin 'FEEDBACK' is disabled.
170515 11:48:09 [Note] Server socket created on IP: '::'.

mysql xampp cannot turn on suddenly

i have been trying to turn on mysql on xampp but it wouldn't turn on. i went to mysql logs and to the errorlog file and here are the things they gave.
2015-11-23 10:54:20 d274 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.
151123 10:54:20 [Note] InnoDB: Using mutexes to ref count buffer pool pages
151123 10:54:20 [Note] InnoDB: The InnoDB memory heap is disabled
151123 10:54:20 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
151123 10:54:20 [Note] InnoDB: Memory barrier is not used
151123 10:54:20 [Note] InnoDB: Compressed tables use zlib 1.2.3
151123 10:54:20 [Note] InnoDB: Not using CPU crc32 instructions
151123 10:54:20 [Note] InnoDB: Initializing buffer pool, size = 16.0M
151123 10:54:20 [Note] InnoDB: Completed initialization of buffer pool
151123 10:54:20 [Note] InnoDB: Highest supported file format is Barracuda.
151123 10:54:20 [Note] InnoDB: Log scan progressed past the checkpoint lsn 1735623
151123 10:54:20 [Note] InnoDB: Database was not shutdown normally!
151123 10:54:20 [Note] InnoDB: Starting crash recovery.
151123 10:54:20 [Note] InnoDB: Reading tablespace information from the .ibd files...
151123 10:54:20 [Note] InnoDB: Restoring possible half-written data pages
151123 10:54:20 [Note] InnoDB: from the doublewrite buffer...
InnoDB: Doing recovery: scanned up to log sequence number 1735633
151123 10:54:20 [Note] InnoDB: 128 rollback segment(s) are active.
151123 10:54:20 [Note] InnoDB: Waiting for purge to start
151123 10:54:20 [Note] InnoDB: Percona XtraDB (http://www.percona.com) 5.6.22-72.0 started; log sequence number 1735633
151123 10:54:20 [Note] Plugin 'FEEDBACK' is disabled.
151123 10:54:20 [Note] Server socket created on IP: '::'.
The log seems ok for me. Maybe you have permission problem, try (right click) run as Administrator the Xampp
try check your active port, maybe used by another program. Mysql use 3306 as default port. go to your xampp folder try find "portcheck.exe" or something like that. see if your mysql port used or free.

Recover DB from ibdata1, ib_logfile0, ib_logfile1 and .frm files

Recently My production server was corrupted due to maintenance shutdown by digital ocean. When we trying to recover our database we couldn't access our droplet. Somehow we managed to recover these (ibdata1, ib_logfile0, ib_logfile1 and some .frm) files. When i copied this files to my new mysql server(in another machine), I could't start the mysql server. I got this output
sudo service mysql restart
mysql stop/waiting
start: Job failed to start
I checked the log file and i got this error,
151019 8:55:27 [Warning] Using unique option prefix myisam-recover instead of $
151019 8:55:27 [Note] Plugin 'FEDERATED' is disabled.
151019 8:55:27 InnoDB: The InnoDB memory heap is disabled
151019 8:55:27 InnoDB: Mutexes and rw_locks use GCC atomic builtins
151019 8:55:27 InnoDB: Compressed tables use zlib 1.2.8
151019 8:55:27 InnoDB: Using Linux native AIO
151019 8:55:27 InnoDB: Initializing buffer pool, size = 128.0M
151019 8:55:27 InnoDB: Completed initialization of buffer pool
InnoDB: Error: log file ./ib_logfile0 is of different size 0 50331648 bytes
InnoDB: than specified in the .cnf file 0 5242880 bytes!
151019 8:55:27 [ERROR] Plugin 'InnoDB' init function returned error.
151019 8:55:27 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
151019 8:55:27 [ERROR] Unknown/unsupported storage engine: InnoDB
151019 8:55:27 [ERROR] Aborting
151019 8:55:27 [Note] /usr/sbin/mysqld: Shutdown complete
151019 8:55:28 [Warning] Using unique option prefix myisam-recover instead of $
151019 8:55:28 [Note] Plugin 'FEDERATED' is disabled.
151019 8:55:28 InnoDB: The InnoDB memory heap is disabled
151019 8:55:28 InnoDB: Mutexes and rw_locks use GCC atomic builtins
151019 8:55:28 InnoDB: Compressed tables use zlib 1.2.8
151019 8:55:28 InnoDB: Using Linux native AIO
151019 8:55:28 InnoDB: Initializing buffer pool, size = 128.0M
151019 8:55:28 InnoDB: Completed initialization of buffer pool
InnoDB: Error: log file ./ib_logfile0 is of different size 0 50331648 bytes
InnoDB: than specified in the .cnf file 0 5242880 bytes!
151019 8:55:28 [ERROR] Plugin 'InnoDB' init function returned error.
151019 8:55:28 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
151019 8:55:28 [ERROR] Unknown/unsupported storage engine: InnoDB
151019 8:55:28 [ERROR] Aborting
151019 8:55:28 [Note] /usr/sbin/mysqld: Shutdown complete
151019 8:55:29 [Warning] Using unique option prefix myisam-recover instead of $
151019 8:55:29 [Note] Plugin 'FEDERATED' is disabled.
151019 8:55:29 InnoDB: The InnoDB memory heap is disabled
151019 8:55:29 InnoDB: Mutexes and rw_locks use GCC atomic builtins
151019 8:55:29 InnoDB: Compressed tables use zlib 1.2.8
151019 8:55:29 InnoDB: Using Linux native AIO
151019 8:55:29 InnoDB: Initializing buffer pool, size = 128.0M
151019 8:55:29 InnoDB: Completed initialization of buffer pool
InnoDB: Error: log file ./ib_logfile0 is of different size 0 50331648 bytes
InnoDB: than specified in the .cnf file 0 5242880 bytes!
151019 8:55:29 [ERROR] Plugin 'InnoDB' init function returned error.
151019 8:55:29 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
151019 8:55:29 [ERROR] Unknown/unsupported storage engine: InnoDB
151019 8:55:29 [ERROR] Aborting
151019 8:55:29 [Note] /usr/sbin/mysqld: Shutdown complete
I tried adding innodb_log_file_size= 50331648 as suggested by #akuzminsky
Then I got this error log.
151022 6:54:13 [Warning] Using unique option prefix myisam-recover instead of $
151022 6:54:13 [Note] Plugin 'FEDERATED' is disabled.
151022 6:54:13 InnoDB: The InnoDB memory heap is disabled
151022 6:54:13 InnoDB: Mutexes and rw_locks use GCC atomic builtins
151022 6:54:13 InnoDB: Compressed tables use zlib 1.2.8
151022 6:54:13 InnoDB: Using Linux native AIO
151022 6:54:13 InnoDB: Initializing buffer pool, size = 128.0M
151022 6:54:13 InnoDB: Completed initialization of buffer pool
151022 6:54:13 InnoDB: highest supported file format is Barracuda.
InnoDB: Log scan progressed past the checkpoint lsn 15379293
151022 6:54:13 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Error: space header page consists of zero bytes in file ./toucan/ormcli$
InnoDB: Error: space header page consists of zero bytes in file ./toucan/catego$
InnoDB: Error: space header page consists of zero bytes in file ./toucan/survey$
InnoDB: Error: space header page consists of zero bytes in file ./toucan/compla$
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
InnoDB: Doing recovery: scanned up to log sequence number 15382291
InnoDB: Page directory corruption: infimum not pointed to
151022 6:54:13 InnoDB: Page dump in ascii and hex (16384 bytes):
len 16384; hex 10cfd0d80000000000000000000000000000000000e9e915000800000000001$
InnoDB: End of page dump
151022 6:54:13 InnoDB: Page checksum 282054872, prior-to-4.0.14-form checksum$
InnoDB: stored checksum 282054872, prior-to-4.0.14-form stored checksum 3468306$
InnoDB: Page lsn 0 15329557, low 4 bytes of lsn at page end 15329557
InnoDB: Page number (if stored to page already) 0,
InnoDB: space id (if created with >= MySQL-4.1.1 and stored already) 0
InnoDB: Page may be a file space header page
10:54:13 UTC - mysqld got signal 11 ;
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=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 = 346701 K $
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
/usr/sbin/mysqld(my_print_stacktrace+0x20)[0x7fa4d90e2f10]
/usr/sbin/mysqld(handle_fatal_signal+0x3d5)[0x7fa4d8fcd175]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x10340)[0x7fa4d7d5d340]
/usr/sbin/mysqld(+0x5f058a)[0x7fa4d91e258a]
/usr/sbin/mysqld(+0x56c44e)[0x7fa4d915e44e]
/usr/sbin/mysqld(+0x576137)[0x7fa4d9168137]
/usr/sbin/mysqld(+0x5a5632)[0x7fa4d9197632]
/usr/sbin/mysqld(+0x5a6699)[0x7fa4d9198699]
/usr/sbin/mysqld(+0x591ad3)[0x7fa4d9183ad3]
/usr/sbin/mysqld(+0x542a1a)[0x7fa4d9134a1a]
/usr/sbin/mysqld(+0x511d48)[0x7fa4d9103d48]
/usr/sbin/mysqld(_Z24ha_initialize_handlertonP13st_plugin_int+0x41)[0x7fa4d8fcf$
/usr/sbin/mysqld(+0x302221)[0x7fa4d8ef4221]
/usr/sbin/mysqld(_Z11plugin_initPiPPci+0x92a)[0x7fa4d8ef821a]
/usr/sbin/mysqld(+0x28ac5b)[0x7fa4d8e7cc5b]
/usr/sbin/mysqld(_Z11mysqld_mainiPPc+0x45b)[0x7fa4d8e815db]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5)[0x7fa4d739fec5]
/usr/sbin/mysqld(+0x286b18)[0x7fa4d8e78b18]
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.
Please help me to resolve this.
Thanks in advance.
Note lines in the error log:
InnoDB: Error: log file ./ib_logfile0 is of different size 0 50331648 bytes
InnoDB: than specified in the .cnf file 0 5242880 bytes!
The actual size of the redo log file differs from the size in MySQL config.
Add this line to my.cnf
innodb_log_file_size= 50331648
If the tablespace is corrupted you'll still have to heal it. But at least MySQL won't stop at this step.

Mysql InnoDB crach

Mysql craches almost every day and I need to restart MYSQL..
Own VPS 512MB ram, mysql logs :
131115 10:03:36 [Note] Plugin 'FEDERATED' is disabled.
131115 10:03:36 InnoDB: The InnoDB memory heap is disabled
131115 10:03:36 InnoDB: Mutexes and rw_locks use GCC atomic builtins
131115 10:03:36 InnoDB: Compressed tables use zlib 1.2.3.4
131115 10:03:36 InnoDB: Initializing buffer pool, size = 128.0M
131115 10:03:36 InnoDB: Completed initialization of buffer pool
131115 10:03:36 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!
131115 10:03:36 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...
Is this log about shutting down or starting?
I suppose your machine was abnormally shut down which caused damage of logs. So, your db files are inconsistent because of mysqld was not stopped gracefully and your log-files (durability records) are inconsistent too because of physical storage damage.

mySQL not running in XAMPP

When I try running MySQL in XAMPP it gives me an error but everything else works fine. I already tried changing the ports on my.ini and I also tried Disabling two services but they were already disabled and enabled but MySQL still refuses to start.
Error:
2013-10-22 17:24:42 5276 [Note] Plugin 'FEDERATED' is disabled.
2013-10-22 17:24:42 8d8 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.
2013-10-22 17:24:42 5276 [Note] InnoDB: The InnoDB memory heap is disabled
2013-10-22 17:24:42 5276 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2013-10-22 17:24:42 5276 [Note] InnoDB: Compressed tables use zlib 1.2.3
2013-10-22 17:24:42 5276 [Note] InnoDB: Not using CPU crc32 instructions
2013-10-22 17:24:42 5276 [Note] InnoDB: Initializing buffer pool, size = 16.0M
2013-10-22 17:24:42 5276 [Note] InnoDB: Completed initialization of buffer pool
2013-10-22 17:24:42 5276 [Note] InnoDB: Highest supported file format is Barracuda.
2013-10-22 17:24:42 5276 [Note] InnoDB: The log sequence numbers 0 and 0 in ibdata files do not match the log sequence number 1600614 in the ib_logfiles!
2013-10-22 17:24:42 5276 [Note] InnoDB: Database was not shutdown normally!
2013-10-22 17:24:42 5276 [Note] InnoDB: Starting crash recovery.
2013-10-22 17:24:42 5276 [Note] InnoDB: Reading tablespace information from the .ibd files...
2013-10-22 17:24:42 5276 [ERROR] InnoDB: Attempted to open a previously opened tablespace. Previous tablespace lg/users uses space ID: 5 at filepath: .\lg\users.ibd. Cannot open tablespace mysql/slave_worker_info which uses space ID: 5 at filepath: .\mysql\slave_worker_info.ibd
InnoDB: Error: could not open single-table tablespace file .\mysql\slave_worker_info.ibd
InnoDB: We do not continue the crash recovery, because the table may become
InnoDB: corrupt if we cannot apply the log records in the InnoDB log to it.
InnoDB: To fix the problem and start mysqld:
InnoDB: 1) If there is a permission problem in the file and mysqld cannot
InnoDB: open the file, you should modify the permissions.
InnoDB: 2) If the table is not needed, or you can restore it from a backup,
InnoDB: then you can remove the .ibd file, and InnoDB will do a normal
InnoDB: crash recovery and ignore that table.
InnoDB: 3) If the file system or the disk is broken, and you cannot remove
InnoDB: the .ibd file, you can set innodb_force_recovery > 0 in my.cnf
InnoDB: and force InnoDB to continue crash recovery here.
I already looked for answers here (Everything that I mentioned I have tried was from here).
Thanks