php PDO 和 MariaDB

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/16195013/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 10:41:35  来源:igfitidea点击:

PDO and MariaDB

phppdomariadb

提问by HenchHacker

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

我已经在 PHP 中使用 PDO 一段时间了,现在使用 MySQL。

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

然而,最近的发展让我认为 MySQL 将开始淡出以取代 MariaDB,尤其是在 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).
  • 认为自己比 MySQL 领先许多年的开发人员,而没有将新的开发投入付费领域(例如集群)。
  • 在 Oracle 接手之后,大多数主要的 MySQL 开发人员都转向了 MariaDB。
  • 正在成为各种 Linux 发行版上替换 MySQL 的默认数据库。
  • MySQL 的替代品正在下降,大公司开始采用 MariaDB,例如 Wikipedia(阅读此处的博客文章)。

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.

所以我的问题是,由于 MariaDB 似乎没有列在 PDO 驱动程序中,并且看到 MariaDB 被设计为“替代品”,并且可能在未来逐步淘汰 MySQL。

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

我可以将 MySQL PDO 驱动程序与 MariaDB 数据库一起使用吗,至少在官方 MariaDB 驱动程序可用之前?

Links

链接

采纳答案by Máté Gelei

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

MariaDB 和 MySQL 100%99% 兼容。这包括连接器兼容性。

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

编辑:到目前为止,MariaDB 工具作为 MySQL 工具(例如 mysqldump)提供,并且数据文件也是二进制兼容的

回答by Your Common Sense

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

我可以将 MySQL PDO 驱动程序与 MariaDB 数据库一起使用吗,至少在官方 MariaDB 驱动程序可用之前?

Yes.

是的。

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

以及 Percona 或任何其他以旧好的 mysql 为核心的 fork。