与 Azure Database for MariaDB 兼容的 MariaDB 驱动程序和管理工具MariaDB drivers and management tools compatible with Azure Database for MariaDB

本文介绍与 Azure Database for MariaDB 兼容的驱动程序和管理工具。This article describes the drivers and management tools that are compatible with Azure Database for MariaDB.

MariaDB 驱动程序MariaDB Drivers

Azure Database for MariaDB 使用 MariaDB 服务器社区版。Azure Database for MariaDB uses the community edition of MariaDB server. 因此,它与多种编程语言和驱动程序兼容。Therefore, it is compatible with a wide variety of programming languages and drivers. MariaDB 的 API 和协议兼容 MySQL 所使用的 API 和协议。MariaDB's API and protocol are compatible with those used by MySQL. 这意味着,兼容 MySQL 的连接器也应兼容 MariaDB。This means that connectors that work with MySQL should also work with MariaDB.

目标是支持三个最新版本的 MariaDB 驱动程序,并且与来自开源社区的创建者共同努力,不断改进 MariaDB 驱动程序的功能和可用性。The goal is to support the three most recent versions MariaDB drivers, and efforts with authors from the open source community to constantly improve the functionality and usability of MariaDB drivers continue. 下表提供了已测试并确认与 Azure Database for MariaDB 10.2 兼容的驱动程序列表:A list of drivers that have been tested and found to be compatible with Azure Database for MariaDB 10.2 is provided in the following table:

驱动程序Driver 链接Links 兼容版本Compatible Versions 不兼容版本Incompatible Versions 说明Notes
PHPPHP https://secure.php.net/downloads.php 5.5、5.6、7.x5.5, 5.6, 7.x 5.35.3 对于 PHP 7.0 与 SSL MySQLi 的连接,请在连接字符串中添加 MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT。For PHP 7.0 connection with SSL MySQLi, add MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT in the connection string.
mysqli_real_connect($conn, $host, $username, $password, $db_name, 3306, NULL, MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT);
PDO 设置:PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT 选项为 false。PDO set: PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT option to false.
.NET.NET GitHub 上的 MySqlConnectorMySqlConnector on GitHub
来自 Nuget 的安装包Installation package from Nuget
0.27 及以上版本0.27 and after 0.26.5 及以下版本0.26.5 and before
MySQL 连接器/NETMySQL Connector/NET MySQL 连接器/NETMySQL Connector/NET 8.0、7.0、6.108.0, 7.0, 6.10 编码错误可能会导致某些非 UTF8 Windows 系统的连接失败。An encoding bug may cause connections to fail on some non-UTF8 Windows systems.
Node.jsNode.js GitHub 上的 MySQLjsMySQLjs on GitHub
来自 NPM 的安装包:Installation package from NPM:
从 NPM 运行 npm install mysqlRun npm install mysql from NPM
2.152.15 2.14.1 及以下版本2.14.1 and before
GOGO https://github.com/go-sql-driver/mysql/releases 1.3、1.41.3, 1.4 1.2 及以下版本1.2 and before 在版本 1.3 的连接字符串中使用 allowNativePasswords=trueUse allowNativePasswords=true in the connection string for version 1.3. 版本 1.4 包含修补程序,不再需要 allowNativePasswords=trueVersion 1.4 contains a fix and allowNativePasswords=true is no longer required.
PythonPython https://pypi.python.org/pypi/mysql-connector-python 1.2.3、2.0、2.1、2.21.2.3, 2.0, 2.1, 2.2 1.2.2 及以下版本1.2.2 and before
JavaJava https://downloads.mariadb.org/connector-java/ 2.1、2.0、1.62.1, 2.0, 1.6 1.5.5 及以下版本1.5.5 and before

管理工具Management Tools

兼容性优势也适用于数据库管理工具。The compatibility advantage extends to database management tools as well. 只要数据库操作在用户权限范围内,现有工具应继续与 Azure Database for MariaDB 配合使用。Your existing tools should continue to work with Azure Database for MariaDB, as long as the database manipulation operates within the confines of user permissions. 下表列出了已测试并确认与 Azure Database for MariaDB 10.2 兼容的三种常用数据库管理工具:Three common database management tools that have been tested and found to be compatible with Azure Database for MariaDB 10.2 are listed in the following table:

操作Action MySQL Workbench 6.x 及以上版本MySQL Workbench 6.x and up Navicat 12Navicat 12 PHPMyAdmin 4.x 及以上版本PHPMyAdmin 4.x and up
创建、更新、读取、写入、删除Create, Update, Read, Write, Delete XX XX XX
SSL 连接SSL Connection XX XX XX
SQL 查询自动完成SQL Query Auto Completion XX XX
导入和导出数据Import and Export Data XX XX XX
导出为多种格式Export to Multiple Formats XX XX XX
备份和还原Backup and Restore XX
显示服务器参数Display Server Parameters XX XX XX
显示客户端连接Display Client Connections XX XX XX

后续步骤Next steps