MariaDB restart restart unexpectedly - mariadb

I've got a problem on my MariaDB server, it sometimes restart randomly (thus causing the different apps using the database to crash).
I'm using MariaDB 10.5.13 on a Debian 9.13 LXC container.
Here's an extract from the log files at the moment of a crash
2021-12-08 15:31:08 0 [Note] InnoDB: Starting crash recovery from checkpoint LSN=136812498411,136812498411
2021-12-08 15:31:08 0 [Note] InnoDB: Starting final batch to recover 959 pages from redo log.
2021-12-08 15:31:13 0 [Note] InnoDB: 128 rollback segments are active.
2021-12-08 15:31:13 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2021-12-08 15:31:13 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2021-12-08 15:31:13 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2021-12-08 15:31:13 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2021-12-08 15:31:13 0 [Note] InnoDB: 10.5.13 started; log sequence number 136845071206; transaction id 181627447
2021-12-08 15:31:13 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2021-12-08 15:31:13 0 [Note] Plugin 'FEEDBACK' is disabled.
2021-12-08 15:31:13 0 [Note] Server socket created on IP: '::'.
2021-12-08 15:31:13 0 [Note] Reading of all Master_info entries succeeded
2021-12-08 15:31:13 0 [Note] Added new Master_info '' to hash table
2021-12-08 15:31:13 0 [Note] /usr/sbin/mariadbd: ready for connections.
2021-12-08 15:31:13 0 [Note] InnoDB: Buffer pool(s) load completed at 211208 15:31:13
2021-12-08 15:31:22 25 [Warning] Aborted connection 25 to db: 'unconnected' user: 'unauthenticated' host: 'localhost' (This connection closed normally without authentication)
2021-12-08 15:36:05 687 [Warning] Aborted connection 687 to db: 'unconnected' user: 'unauthenticated' host: 'localhost' (This connection closed normally without authentication)
2021-12-08 15:41:08 0 [Note] InnoDB: Uses event mutexes
2021-12-08 15:41:08 0 [Note] InnoDB: Compressed tables use zlib 1.2.8
2021-12-08 15:41:08 0 [Note] InnoDB: Number of pools: 1
2021-12-08 15:41:08 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
2021-12-08 15:41:08 0 [Note] InnoDB: Using Linux native AIO
2021-12-08 15:41:08 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
2021-12-08 15:41:08 0 [Note] InnoDB: Completed initialization of buffer pool
2021-12-08 15:41:08 0 [Note] InnoDB: Starting crash recovery from checkpoint LSN=136812498411,136812498411
2021-12-08 15:41:08 0 [Note] InnoDB: Starting final batch to recover 1117 pages from redo log.
2021-12-08 15:41:12 0 [Note] InnoDB: 128 rollback segments are active.
2021-12-08 15:41:13 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2021-12-08 15:41:13 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2021-12-08 15:41:13 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2021-12-08 15:41:13 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2021-12-08 15:41:13 0 [Note] InnoDB: 10.5.13 started; log sequence number 136864854170; transaction id 181644325
2021-12-08 15:41:13 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2021-12-08 15:41:13 0 [Note] Plugin 'FEEDBACK' is disabled.
2021-12-08 15:41:13 0 [Note] Server socket created on IP: '::'.
2021-12-08 15:41:13 0 [Note] Reading of all Master_info entries succeeded
2021-12-08 15:41:13 0 [Note] Added new Master_info '' to hash table
2021-12-08 15:41:13 0 [Note] /usr/sbin/mariadbd: ready for connections.
2021-12-08 15:41:13 0 [Note] InnoDB: Buffer pool(s) load completed at 211208 15:41:13
2021-12-08 15:41:22 23 [Warning] Aborted connection 23 to db: 'unconnected' user: 'unauthenticated' host: 'localhost' (This connection closed normally without authentication)
2021-12-08 15:45:50 263 [Warning] Aborted connection 263 to db: 'unconnected' user: 'unauthenticated' host: 'localhost' (This connection closed normally without authentication)
2021-12-08 15:51:04 0 [Note] InnoDB: Uses event mutexes
2021-12-08 15:51:04 0 [Note] InnoDB: Compressed tables use zlib 1.2.8
2021-12-08 15:51:04 0 [Note] InnoDB: Number of pools: 1
2021-12-08 15:51:04 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
2021-12-08 15:51:04 0 [Note] InnoDB: Using Linux native AIO
2021-12-08 15:51:04 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
2021-12-08 15:51:04 0 [Note] InnoDB: Completed initialization of buffer pool
2021-12-08 15:51:04 0 [Note] InnoDB: Starting crash recovery from checkpoint LSN=136812498411,136812498411
Would anyone have recommandations to tackle this problem ?
Thanks,
Edit : I paste the full logs between two crashes. I don't know what the aborted connections are given that I only use this DB server from clients on other container, not on localhost.
Edit 2 : Here's a link to download the whole file :
https://cloud.ei-bs.eu/index.php/s/NsMjezd3mB25AAY

Related

ERROR: InnoDB: Invalid flags 0x4800 in ./ibdata1 when installing MariaDB on macOS Ventura via Homebrew

I'm trying to install MariaDB (Ver 10.8.3-MariaDB for osx10.18 on arm64) via Homebrew (3.6.8) on macOS Ventura (13.0, Apple M1 Max) with the following steps:
brew install mariadb
Summary looks fine:
==> Summary
🍺 /opt/homebrew/Cellar/mariadb/10.8.3_1: 917 files, 174.8MB
But the following warning attracts my attention:
Warning: The post-install step did not complete successfully
You can try again using:
brew postinstall mariadb
Then when I run mysql I get the error:
ERROR 2002 (HY000): Can't connect to local server through socket '/tmp/mysql.sock' (2)
Running mysqld lists the following lines:
2022-11-03 16:01:12 0 [Note] mysqld (server 10.8.3-MariaDB) starting as process 94524 ...
2022-11-03 16:01:12 0 [Warning] Setting lower_case_table_names=2 because file system for /opt/homebrew/var/mysql/ is case insensitive
2022-11-03 16:01:12 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2022-11-03 16:01:12 0 [Note] InnoDB: Number of transaction pools: 1
2022-11-03 16:01:12 0 [Note] InnoDB: Using generic crc32 instructions
2022-11-03 16:01:12 0 [Note] InnoDB: Initializing buffer pool, total size = 128.000MiB, chunk size = 2.000MiB
2022-11-03 16:01:12 0 [Note] InnoDB: Completed initialization of buffer pool
2022-11-03 16:01:12 0 [ERROR] InnoDB: Invalid flags 0x4800 in ./ibdata1
2022-11-03 16:01:12 0 [ERROR] InnoDB: Plugin initialization aborted with error Data structure corruption
2022-11-03 16:01:12 0 [Note] InnoDB: Starting shutdown...
2022-11-03 16:01:12 0 [ERROR] Plugin 'InnoDB' init function returned error.
2022-11-03 16:01:12 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2022-11-03 16:01:12 0 [Note] Plugin 'FEEDBACK' is disabled.
2022-11-03 16:01:12 0 [ERROR] Could not open mysql.plugin table: "Table 'mysql.plugin' doesn't exist". Some plugins may be not loaded
2022-11-03 16:01:12 0 [ERROR] mysqld: unknown variable 'mysqlx-bind-address=127.0.0.1'
2022-11-03 16:01:12 0 [ERROR] Aborting
But unfortunately I have no clue how to solve the first listed error and I can't find any information about it:
2022-11-03 16:01:12 0 [ERROR] InnoDB: Invalid flags 0x4800 in ./ibdata1
On advice I've deleted /opt/homebrew/var/mysql and reinstalled MariaDB, unfortunately with the same behavior afterwards. The new mysql direction contains:
this-mac.local.err
aria_log_control
ib_logfile0
aria_log.00000001
ib_buffer_pool
ibdata1
The […].local.err now contains:
221104 00:08:48 mysqld_safe Starting mariadbd daemon with databases from /opt/homebrew/var/mysql
2022-11-04 0:08:48 0 [Note] /opt/homebrew/opt/mariadb/bin/mariadbd (server 10.8.3-MariaDB) starting as process 12788 ...
2022-11-04 0:08:48 0 [Warning] Setting lower_case_table_names=2 because file system for /opt/homebrew/var/mysql/ is case insensitive
2022-11-04 0:08:48 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2022-11-04 0:08:48 0 [Note] InnoDB: Number of transaction pools: 1
2022-11-04 0:08:48 0 [Note] InnoDB: Using generic crc32 instructions
2022-11-04 0:08:48 0 [Note] InnoDB: Initializing buffer pool, total size = 128.000MiB, chunk size = 2.000MiB
2022-11-04 0:08:48 0 [Note] InnoDB: Completed initialization of buffer pool
2022-11-04 0:08:48 0 [Note] InnoDB: 128 rollback segments are active.
2022-11-04 0:08:48 0 [Note] InnoDB: Setting file './ibtmp1' size to 12.000MiB. Physically writing the file full; Please wait ...
2022-11-04 0:08:48 0 [Note] InnoDB: File './ibtmp1' size is now 12.000MiB.
2022-11-04 0:08:48 0 [Note] InnoDB: log sequence number 36426; transaction id 4
2022-11-04 0:08:48 0 [Note] Plugin 'FEEDBACK' is disabled.
2022-11-04 0:08:48 0 [Note] InnoDB: Loading buffer pool(s) from /opt/homebrew/var/mysql/ib_buffer_pool
2022-11-04 0:08:48 0 [ERROR] Could not open mysql.plugin table: "Table 'mysql.plugin' doesn't exist". Some plugins may be not loaded
2022-11-04 0:08:48 0 [ERROR] /opt/homebrew/opt/mariadb/bin/mariadbd: unknown variable 'mysqlx-bind-address=127.0.0.1'
2022-11-04 0:08:48 0 [ERROR] Aborting
221104 00:08:48 mysqld_safe mysqld from pid file /opt/homebrew/var/mysql/MacBook-Pro-von-Malte.local.pid ended
I'm thankful for any hint and I'd like to give any additional information, if needed.
"Invalid flags 0x4800 in ./ibdata1" is an indication that the datadir was installed with MySQL-8.0.
MariaDB cannot start on a MySQL-8.0 datadir.
Also "mysqlx-bind-address=127.0.0.1" is a MySQL only system variable.
To install MariaDB you'll need to remove the MySQL datadir and configuration files first. (And backup any data there if its important).

How to solve an error regarding failed to initialise plugins in XAMPP?

I have the following message when I try to start my database in XAMP:
Error: MySQL shutdown unexpectedly. This may be due to a blocked port,
missing dependencies, improper privileges, a crash, or a shutdown by
another method. Press the Logs button to view error logs and check the
Windows Event Viewer for more clues. If you need more help, copy and
post this entire log window on the forums.
Here are my logs errors:
Cannot find checkpoint record at LSN (1,0x5946)
2022-08-31 17:08:07 0 [ERROR] mysqld.exe: Aria recovery failed. Please
run aria_chk -r on all Aria tables and delete all aria_log.########
files
2022-08-31 17:08:07 0 [ERROR] Plugin 'Aria' init function returned error.
2022-08-31 17:08:07 0 [ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed.
2022-08-31 17:08:07 0 [Note] InnoDB: Mutexes and rw_locks use Windows
interlocked functions
2022-08-31 17:08:07 0 [Note] InnoDB: Uses event mutexes
2022-08-31 17:08:07 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2022-08-31 17:08:07 0 [Note] InnoDB: Number of pools: 1
2022-08-31 17:08:07 0 [Note] InnoDB: Using SSE2 crc32 instructions
2022-08-31 17:08:07 0 [Note] InnoDB: Initializing buffer pool, total
size = 16M, instances = 1, chunk size = 16M
2022-08-31 17:08:07 0 [Note] InnoDB: Completed initialization of
buffer pool
2022-08-31 17:08:07 0 [Note] InnoDB: 128 out of 128 rollback segments
are active.
2022-08-31 17:08:07 0 [Note] InnoDB: Creating shared tablespace for
temporary tables
2022-08-31 17:08:07 0 [Note] InnoDB: Setting file
'C:\xampp\mysql\data\ibtmp1' size to 12 MB. Physically writing the
file full; Please wait ...
2022-08-31 17:08:07 0 [Note] InnoDB: File 'C:\xampp\mysql\data\ibtmp1'
size is now 12 MB.
2022-08-31 17:08:07 0 [Note] InnoDB: Waiting for purge to start
2022-08-31 17:08:07 0 [Note] InnoDB: 10.4.24 started; log sequence
number 274011788; transaction id 115120
2022-08-31 17:08:07 0 [Note] InnoDB: Loading buffer pool(s) from
C:\xampp\mysql\data\ib_buffer_pool
2022-08-31 17:08:07 0 [Note] Plugin 'FEEDBACK' is disabled.
2022-08-31 17:08:07 0 [Note] InnoDB: Buffer pool(s) load completed at
220831 17:08:07
2022-08-31 17:08:07 0 [ERROR] Could not open mysql.plugin table. Some plugins may be not loaded
2022-08-31 17:08:07 0 [ERROR] Failed to initialize plugins.
2022-08-31 17:08:07 0 [ERROR] Aborting
How could I fix this? Thank you in advance for any attempt to clarify this!
Stop the service. Delete from c:\xampp\mysql\data the files: "aria_log.00000001" and "aria_log_control" and start the service again. The files will be created again automatically and it will work.

MariaDB is not starting even after port has been change

Can any body tell how backup database without mysql start.
Mysql error log is below
InnoDB: using atomic writes.
2021-09-10 23:59:01 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2021-09-10 23:59:01 0 [Note] InnoDB: Uses event mutexes
2021-09-10 23:59:01 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2021-09-10 23:59:01 0 [Note] InnoDB: Number of pools: 1
2021-09-10 23:59:01 0 [Note] InnoDB: Using SSE2 crc32 instructions
2021-09-10 23:59:01 0 [Note] InnoDB: Initializing buffer pool, total size = 64M, instances = 1, chunk size = 64M
2021-09-10 23:59:01 0 [Note] InnoDB: Completed initialization of buffer pool
2021-09-10 23:59:01 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2021-09-10 23:59:01 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2021-09-10 23:59:01 0 [Note] InnoDB: Setting file 'C:\xampp\mysql\data\ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2021-09-10 23:59:01 0 [Note] InnoDB: File 'C:\xampp\mysql\data\ibtmp1' size is now 12 MB.
2021-09-10 23:59:01 0 [Note] InnoDB: Waiting for purge to start
2021-09-10 23:59:01 0 [Note] InnoDB: 10.4.14 started; log sequence number 47063; transaction id 9
2021-09-10 23:59:01 0 [Note] InnoDB: Loading buffer pool(s) from C:\xampp\mysql\data\ib_buffer_pool
2021-09-10 23:59:01 0 [Note] Plugin 'FEEDBACK' is disabled.
2021-09-10 23:59:01 0 [Note] InnoDB: Buffer pool(s) load completed at 210910 23:59:01
2021-09-10 23:59:01 0 [Note] Server socket created on IP: '::'.

ERROR! MariaDB server PID file could not be found

After a hard restart on macOS (monitor blacked out) i can't get my mariadb to work.
ERROR! MariaDB server PID file could not be found! Starting MariaDB .210121 09:45:40 mysqld_safe Logging to '/usr/local/var/mysql/computer.local.err'
Logfile: /usr/local/var/mysql/computer.local.err
2021-01-21 9:48:16 0 [Note] InnoDB: Uses event mutexes
2021-01-21 9:48:16 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2021-01-21 9:48:16 0 [Note] InnoDB: Number of pools: 1
2021-01-21 9:48:16 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
2021-01-21 9:48:16 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
2021-01-21 9:48:16 0 [Note] InnoDB: Completed initialization of buffer pool
2021-01-21 9:48:16 0 [ERROR] InnoDB: Upgrade after a crash is not supported. The redo log was created with MariaDB 10.4.11.
2021-01-21 9:48:16 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2021-01-21 9:48:16 0 [Note] InnoDB: Starting shutdown...
2021-01-21 9:48:16 0 [ERROR] Plugin 'InnoDB' init function returned error.
2021-01-21 9:48:16 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2021-01-21 9:48:16 0 [Note] Plugin 'FEEDBACK' is disabled.
2021-01-21 9:48:16 0 [ERROR] Unknown/unsupported storage engine: InnoDB
Mariadb is installed via homebrew
I have restarted and reinstalled mariadb via homebrew
any ideas how to fix this? :)
Solution
If found the solution, That is, to remove these /var/lib/mysql/ib_logfile*. Those logfiles prevented mariadb to start

mySQL is not starting at all

These are the errors (attached below). I have tried all the solution previously suggested on overflow and none is working.
-When i delete ibdata1, it doesn't seem to go away.I find data of 75,776kb every-time i reopen data file.
11:57:38 AM [mysql] Error: MySQL shutdown unexpectedly.
11:57:38 AM [mysql] This may be due to a blocked port, missing dependencies,
11:57:38 AM [mysql] improper privileges, a crash, or a shutdown by another method.
11:57:38 AM [mysql] Press the Logs button to view error logs and check
11:57:38 AM [mysql] the Windows Event Viewer for more clues
11:57:38 AM [mysql] If you need more help, copy and post this
11:57:38 AM [mysql] entire log window on the forums
InnoDB: using atomic writes.
2020-01-24 11:44:50 0 [Note] InnoDB: The first innodb_system data file 'ibdata1' did not exist. A new tablespace will be created!
2020-01-24 11:44:50 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2020-01-24 11:44:50 0 [Note] InnoDB: Uses event mutexes
2020-01-24 11:44:50 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2020-01-24 11:44:50 0 [Note] InnoDB: Number of pools: 1
2020-01-24 11:44:50 0 [Note] InnoDB: Using SSE2 crc32 instructions
2020-01-24 11:44:50 0 [Note] InnoDB: Initializing buffer pool, total size = 16M, instances = 1, chunk size = 16M
2020-01-24 11:44:50 0 [Note] InnoDB: Completed initialization of buffer pool
2020-01-24 11:44:50 0 [Note] InnoDB: Setting file 'C:\xampp\mysql\data\ibdata1' size to 10 MB. Physically writing the file full; Please wait ...
2020-01-24 11:44:50 0 [Note] InnoDB: File 'C:\xampp\mysql\data\ibdata1' size is now 10 MB.
2020-01-24 11:44:50 0 [Note] InnoDB: Setting log file C:\xampp\mysql\data\ib_logfile101 size to 5242880 bytes
2020-01-24 11:44:50 0 [Note] InnoDB: Setting log file C:\xampp\mysql\data\ib_logfile1 size to 5242880 bytes
2020-01-24 11:44:50 0 [Note] InnoDB: Renaming log file C:\xampp\mysql\data\ib_logfile101 to C:\xampp\mysql\data\ib_logfile0
2020-01-24 11:44:50 0 [Note] InnoDB: New log files created, LSN=11452
2020-01-24 11:44:50 0 [Note] InnoDB: Doublewrite buffer not found: creating new
2020-01-24 11:44:50 0 [Note] InnoDB: Doublewrite buffer created
2020-01-24 11:44:50 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2020-01-24 11:44:50 0 [Note] InnoDB: Creating foreign key constraint system tables.
2020-01-24 11:44:50 0 [Note] InnoDB: Creating tablespace and datafile system tables.
2020-01-24 11:44:50 0 [Note] InnoDB: Creating sys_virtual system tables.
2020-01-24 11:44:50 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2020-01-24 11:44:50 0 [Note] InnoDB: Setting file 'C:\xampp\mysql\data\ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2020-01-24 11:44:50 0 [Note] InnoDB: File 'C:\xampp\mysql\data\ibtmp1' size is now 12 MB.
2020-01-24 11:44:50 0 [Note] InnoDB: Waiting for purge to start
2020-01-24 11:44:50 0 [Note] InnoDB: 10.4.11 started; log sequence number 0; transaction id 7
2020-01-24 11:44:50 0 [Note] Plugin 'FEEDBACK' is disabled.
2020-01-24 11:44:50 0 [Note] Server socket created on IP: '::'.
The "tablespace" called ibdata1 is vital to operations of MySQL and MariaDB. Do not remove it; you will lose any database tables you have created.
It comes back because it must have it and it is initialized if it is missing. The size always starts out the same due to a configuration parameter. It may grow later.
innodb_buffer_pool_size seems to be initialized at 16MB. It is dubious as to whether it will work at that tiny size. Certainly performance will suffer. Suggest at least 128M. See /etc/my.cnf, or perhaps somewhere else.

Resources