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 一起使用吗?
基础教程推荐
- 如何在 CakePHP 3 中实现 INSERT ON DUPLICATE KEY UPDATE aka upsert? 2021-01-01
- while 在触发器内循环以遍历 sql 中表的所有列 2022-01-01
- 从字符串 TSQL 中获取数字 2021-01-01
- CHECKSUM 和 CHECKSUM_AGG:算法是什么? 2021-01-01
- 带更新的 sqlite CTE 2022-01-01
- ORA-01830:日期格式图片在转换整个输入字符串之前结束/选择日期查询的总和 2021-01-01
- 带有WHERE子句的LAG()函数 2022-01-01
- MySQL根据从其他列分组的值,对两列之间的值进行求和 2022-01-01
- 使用 VBS 和注册表来确定安装了哪个版本和 32 位 2021-01-01
- MySQL 5.7参照时间戳生成日期列 2022-01-01
