What is a correct method to create a database from scratch in Windows and/or Linux OS for MariaDB 10.1?

When using MariaDB 5.5 in either Linux or Microsoft Windows environments, I always followed the following procedure when installing a newer version in the same branch (eg. 5.5.50 to 5.5.51):

- Dump all databases - Dump the user and grant tables from mysql databases - Stop the database (eg. version 5.5.50) - Upgrade the database (eg. version 5.5.51) - Replace the provided my.ini or my.cnf file with my custom one - Import the user and grant table into mysql database - Restart the database - Execute mysql_upgrade to upgrade any necessary tables - Import all previously backed up databases - Done

This procedure worked fine when I wanted to change the size of log and ibdata files.

So, I thought it's time to upgrade to version 10.1. At the time of this post, version 10.1.19 is the latest stable. I downloaded it and tried to following the previous steps as I describe above. The procedure fails, because three new tables are stored inside the ibdata file and I cannot delete the file now. If I do so, when I run mysql_upgrade the procedure fails because it cannot find tables gtid_slave_pos, innodb_index_stats and innodb_table_stats.

So after all this introduction, the big question is:

What is the "correct" procedure to install a new database data folder from scratch in MariaDB 10.1?

Answer Answered by Ian Gilfillan in this comment.

You don't need to re-import all of your data everytime you do an upgrade. You can just leave the data as is and upgrade, run mysql_upgrade, and everything should work

The correct procedures (from 5.5 to 10.1) are described at Upgrading from MariaDB 5.5 to MariaDB 10.0 and Upgrading from MariaDB 10.0 to 10.1.

Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.