Does MySQL#39;s Connector/J work with MariaDB?(MySQL 的 Connector/J 可以与 MariaDB 一起使用吗?)
问题描述
我正在尝试使用 此处的 Connector/J 连接到我的 MariaDB 数据库a>,但这无法正常工作并且 MariaDB 会记录 `
I'm attempting to connect to my MariaDB database using Connector/J from here, but this fails to work and MariaDB logs `
"[警告] 与 db 的连接 12 中止:'enwikt_parsed' 用户:'javawiki' 主机:'localhost'(读取通信时出错数据包)".
"[Warning] Aborted connection 12 to db: 'enwikt_parsed' user: 'javawiki' host: 'localhost' (Got an error reading communication packets)".
`
我突然想到,我只是假设 MySQL 中的 Connector/J 可以与 MariaDB 一起使用,但现在我不太确定.我知道 MariaDB 有自己的 Java API/连接器,但我正在使用其他人的代码来 parse wiktionary,因此无法使用.
It occurs to me that I just assumed Connector/J from MySQL would just work with MariaDB, but now I'm not so sure. I know MariaDB has their own Java API/Connector, but I'm using someone else's code to parse wiktionary, and therefore can't use it.
在我尝试一些更复杂的解决方案之前,我想知道我是否正在尝试修复一些原本不打算以这种方式使用的东西.
Before I try some more involved solutions, I'd like to know if I'm trying to fix something that wasn't meant to be used this way in the first place.
推荐答案
是的,MySQL 的 Connector/J 兼容 MariaDB.您需要检查版本.
Yes, MySQL's Connector/J is compatible with MariaDB. You need to check version though.
出于所有实际目的,MariaDB 是替代相同的 MySQL 版本(例如 MySQL 5.1 -> MariaDB 5.1、MariaDB5.2 &MariaDB 5.3 是兼容的.MySQL 5.5 与 MariaDB 5.5 兼容,在实践中也与 MariaDB 10.0 兼容,MySQL 5.6 与 MariaDB 10.0 兼容,MySQL 5.7 与 MariaDB 10.2 兼容)
For all practical purposes, MariaDB is a binary drop in replacement of the same MySQL version (for example MySQL 5.1 -> MariaDB 5.1, MariaDB 5.2 & MariaDB 5.3 are compatible. MySQL 5.5 is compatible with MariaDB 5.5 and also in practice with MariaDB 10.0, MySQL 5.6 is compatible with MariaDB 10.0 and MySQL 5.7 is compatible with MariaDB 10.2)
参考:https://mariadb.com/kb/en/library/mariadb-vs-mysql-compatibility/
所有 MySQL 连接器(PHP、Perl、Python、Java、.NET、MyODBC、Ruby、MySQL C 连接器等)在 MariaDB 中的工作不变.
All MySQL connectors (PHP, Perl, Python, Java, .NET, MyODBC, Ruby, MySQL C connector etc) works unchanged with MariaDB.
这篇关于MySQL 的 Connector/J 可以与 MariaDB 一起使用吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:MySQL 的 Connector/J 可以与 MariaDB 一起使用吗?
基础教程推荐
- 如何在 SQL Server 的嵌套过程中处理事务? 2021-01-01
- SQL Server 2016更改对象所有者 2022-01-01
- SQL Server:只有 GROUP BY 中的最后一个条目 2021-01-01
- 在 VB.NET 中更新 SQL Server DateTime 列 2021-01-01
- Sql Server 字符串到日期的转换 2021-01-01
- ERROR 2006 (HY000): MySQL 服务器已经消失 2021-01-01
- 使用pyodbc“不安全"的Python多处理和数据库访问? 2022-01-01
- 将数据从 MS SQL 迁移到 PostgreSQL? 2022-01-01
- SQL Server 中单行 MERGE/upsert 的语法 2021-01-01
- 无法在 ubuntu 中启动 mysql 服务器 2021-01-01