# MariaDB not starting even in safe mode.



## Understudy (Apr 5, 2021)

Hi All,

Recently did a switch from MySQL8 to MariaDB105 via `pkg`.  Currently running 12.2-RELEASE-p4 FreeBSD 12.2-RELEASE-p4 GENERIC  amd64
The issue comes up when I try to start it.

`root@postal:~ # service mysql-server start
Starting mysql.
root@postal:~ # service mysql-server status
mysql is not running.`

Even when I try it with

`mysqld_safe`

I get the same thing.

The log says this :


```
2021-04-04 23:09:19 0 [Note] InnoDB: Uses event mutexes
2021-04-04 23:09:19 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2021-04-04 23:09:19 0 [Note] InnoDB: Number of pools: 1
2021-04-04 23:09:19 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
2021-04-04 23:09:19 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
2021-04-04 23:09:19 0 [Note] InnoDB: Completed initialization of buffer pool
2021-04-04 23:09:19 0 [ERROR] InnoDB: Invalid flags 0x4800 in ./ibdata1
2021-04-04 23:09:19 0 [ERROR] InnoDB: Plugin initialization aborted with error Data structure corruption
2021-04-04 23:09:19 0 [Note] InnoDB: Starting shutdown...
2021-04-04 23:09:19 0 [ERROR] Plugin 'InnoDB' init function returned error.
2021-04-04 23:09:19 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2021-04-04 23:09:19 0 [Note] Plugin 'FEEDBACK' is disabled.
2021-04-04 23:09:19 0 [ERROR] Could not open mysql.plugin table: "Table 'mysql.plugin' doesn't exist". Some plugins may be not loaded
2021-04-04 23:09:19 0 [ERROR] Unknown/unsupported storage engine: InnoDB
2021-04-04 23:09:19 0 [ERROR] Aborting
2021-04-04 23:10:38 0 [Note] InnoDB: Uses event mutexes
2021-04-04 23:10:38 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2021-04-04 23:10:38 0 [Note] InnoDB: Number of pools: 1
2021-04-04 23:10:38 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
2021-04-04 23:10:38 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
2021-04-04 23:10:38 0 [Note] InnoDB: Completed initialization of buffer pool
2021-04-04 23:10:38 0 [ERROR] InnoDB: Invalid flags 0x4800 in ./ibdata1
2021-04-04 23:10:38 0 [ERROR] InnoDB: Plugin initialization aborted with error Data structure corruption
2021-04-04 23:10:38 0 [Note] InnoDB: Starting shutdown...
```


----------



## richardtoohey2 (Apr 5, 2021)

The database is corrupted - but most likely to it being a different format between MySQL and MariaDB:



Understudy said:


> 2021-04-04 23:09:19 0 [ERROR] InnoDB: Invalid flags 0x4800 in ./ibdata1 2021-04-04 23:09:19 0 [ERROR] InnoDB: Plugin initialization aborted with error Data structure corruption


----------



## ct85711 (Apr 5, 2021)

Doing a quick search about the error, you could potentially try recovery and see if mariadb can recover from the corruption.

https://mariadb.com/kb/en/innodb-recovery-modes/
This goes over the recovery settings, to try (hopefully you have some backups in case).

One thing I did see posts about, is DO NOT delete the ibdata1 file; as it contains the data from the database.  If there is no data to worry about, it is safe to delete  as it will be recreated.
https://dba.stackexchange.com/questions/166813/recover-mysql-ibdata1-file
https://stackoverflow.com/questions...restart-get-affected-if-ibdata1-file-is-moved


----------



## VladiBG (Apr 5, 2021)

You can't migrate MySQL 8 data files to MariaDB. You need to use MySQL Dump to create a full backup then to remove the MySQL 8 install MariaDB and restore the backup.

Note: Be careful with utf-8 collation as they are different in MariaDB









						Migrating to MariaDB from MySQL
					






					mariadb.com


----------

