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:
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
Connecting to and communicating with an underlying MariaDB database is facilitated by the PDO extension.
PDO will work on 12 different database systems, whereas MySQLi will only work with MySQL databases. So, if you have to switch your project to use another database, PDO makes the process easy. You only have to change the connection string and a few queries.
MySQLi is a replacement for the mysql functions, with object-oriented and procedural versions. It has support for prepared statements. PDO (PHP Data Objects) is a general database abstraction layer with support for MySQL among many other databases.
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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With