Which way should be selected when move from mysql to mariadb? Now, the mysql version is 5.1.I plan to move to mariadb 10.2.Use mysqldump and source to update databases.
Based on MySQL Upgrade Strategies,


  Upgrading to the latest release is recommended before upgrading to the
  next version


.
Way 1:mysql 5.1-&gt;mysql 5.7-&gt;mariadb 10.2
Way 2:mysql 5.1-&gt;mariadb 5.1-&gt;mariadb 10.2
Which way is better(less data loss)?
We can't do anything without a problem except point you to the official information,


How to migrate from MySQL to MariaDB on Linux in five steps
Migrating to MariaDB


Generally the further you are from an original fork the more complexities you'll encounter in the migration. Therefore the earlier the version of MySQL the fewer features of MySQL that are MySQL-specific that you'll have to contend with. Upgrading to a newer of MySQL before the migration to MariaDB is likely to make your job harder.