Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Change MariaDB storage engine to InnoDB for default mysql database tables: db, host and user

One can change the storage engine type for a specific table with:

ALTER TABLE table_name ENGINE = InnoDB;

This works for all tables EXCEPT the db, host and user table that come with the MySQL installation. It throws an (generic) error:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

MariaDB [mysql]> ALTER TABLE db ENGINE = InnoDB;
ERROR 1025 (HY000): Error on rename of './mysql/#sql-149_24b' to './mysql/db' (errno: 168 "Unknown (generic) error from engine")
MariaDB [mysql]> ALTER TABLE host ENGINE = InnoDB;
ERROR 1025 (HY000): Error on rename of './mysql/#sql-149_24b' to './mysql/host' (errno: 168 "Unknown (generic) error from engine")
MariaDB [mysql]> ALTER TABLE user ENGINE = InnoDB;
ERROR 1025 (HY000): Error on rename of './mysql/#sql-149_24b' to './mysql/user' (errno: 168 "Unknown (generic) error from engine")

I can see why changing the engine of a running database would be problematic for these specific tables (as they hold the db and user info). But how would one go about changing this?

>Solution :

You can’t change the engone

In MariaDB 10.3 and before, this table uses the MyISAM storage engine.

Why not update

In MariaDB 10.4 and later, the mysql.global_priv table has replaced the mysql.user table, and mysql.user should be considered obsolete.

see manual

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading