Home » Php » php – PDO and MariaDB

php – PDO and MariaDB

Posted by: admin April 23, 2020 Leave a comment

Questions:

I’ve been using PDO in PHP for a while now utilizing MySQL.

However, recent developments have made me think that MySQL will start fading out in replacement of MariaDB especially since MariaDB:

  • Consider themselves many developer years ahead of MySQL without putting new developments into paid areas (clustering for example).
  • The majority of the main MySQL developers moved to MariaDB after Oracle took over.
  • Is becoming the default database to replace MySQL on various Linux distributions.
  • Is a drop in replacement of MySQL and large companies are starting to adopt MariaDB such as Wikipedia (Read the blog post here).

So my question is, since MariaDB doesn’t appear to be listed in the PDO drivers and seeing as MariaDB is designed to be a “drop in replacement” and could potentially phase out MySQL in the future.

Can I use the MySQL PDO driver with a MariaDB database, at least until an official MariaDB driver becomes available?

Links

How to&Answers:

MariaDB and MySQL are 100% 99% compatible. This includes connector compatibility.

edit: up to the point that MariaDB tools are shipped as MySQL tools (e.g. mysqldump), and data files are binary compatible, too

Answer:

Can I use the MySQL PDO driver with a MariaDB database, at least until an official MariaDB driver becomes available?

Yes.

As well as Percona or any other fork that being old good mysql in it’s core.