0

The web host that I use provides free database via MySQL v5.6.38. Recently, they switched to MariaDB v10.3.31

They converted all my databases and all my apps still work as expected. The problem is I've put in considerable effort into learning MySQL over two years and so I don't want to abandon it. I know MariaDB is based on MySQL and so there's some good compatibility until MySQL 8. I want to keep developing on MySQL and then just convert/port that particular database to MariaDB. Is there a way to do this?

Most articles talk about converting/upgrading the whole MySQL instance and its databases to MariaDB. How do I convert just a single database from MySQL format to MariaDB format?

Thanks.

UPDATE: While MariaDB is seemingly better than MySQL, MySQL is more popular & more common. For this reason, my plan is to use only features & functions that are common between both of them. - If I happen to change web hosts in the future and the new webhost doesn't offer MariaDB, then I'll have a lot of work to do if I have used features specific to MariaDB.

1
  • If you are used to 5.6, you will hardly notice anything different in 10.3. If you start using CTEs and windowing functions, then a future change to 8.0 will also be relatively painless. (Going back to 5.6 could be a problem.)
    – Rick James
    Apr 4, 2022 at 0:16

1 Answer 1

3

If you develop on a MySQL-5.7 or earlier, most features there are MariaDB compatible (exceptions).

There's no real convert to MariaDB format in a MySQL server.

Your learning isn't wasted. There is significant similarity with MariaDB, especially with such an old version of MySQL that you where developing for.

If MariaDB-10.3 is your hosted application, its prudent to use the same in your development version that way the small number of differences will show up in your development rather than a last pre-deployment step. This will also give you the opportunity to use new database features that are available on your host, like common table expressions, window functions, sequences, and other functions.

6
  • Also I have to notice that MariaDB 10.4+ parser has a more strict syntax and some routines from earlier versions may fail in a strange way. For example versions prior to 10.4 raise no errors for routines using undeclared variables, while on 10.4+ the same routines will not even shown by SHOW PROCEDURE STATUS LIKE 'xxxxx'; after upgrade.
    – Kondybas
    Apr 5, 2022 at 21:11
  • @danblack Bummer that there is no way to convert just 1 database, Apr 7, 2022 at 5:08
  • "There's no real convert to MariaDB format in a MySQL server.". You can't make a MySQL server pretend its MariaDB. You can run multiple MySQL and MariaDB instances on the same host provided you separate their datadir, port, and socket are not conflicting. So you can export one database to an actual MariaDB instance, however the concept of an in-place convert cannot happen.
    – danblack
    Apr 7, 2022 at 5:15
  • Sorry about the confusion. I don't mean using a MySQL Server to convert to MariaDB format. I'm asking if there's a third party utility that can do the conversion or perhaps even MariaDB it self. Please see the update in the question. Thanks. Apr 7, 2022 at 5:20
  • MariaDB should be able to read a MySQL-5.6 data directory. Otherwise and mysqldump of the database should import as is. Third option in assisted tools is sqlines (who seem to be having website cert troubles at the moment).
    – danblack
    Apr 7, 2022 at 5:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.