Eclipse - 如何添加新的 MariaDB 连接

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/36557936/
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-09-19 23:07:40  来源:igfitidea点击:

Eclipse - How to add a new MariaDB connection

mysqleclipsejdbcdatabase-connectionmariadb

提问by Aliuk

How can I add a new MariaDB connection to eclipse?

如何向 Eclipse 添加新的 MariaDB 连接?

I am using the Data Source Explorer view, however when I try to create a new database connection there are connections for MySQL, Oracle, Informix... but no for MariaDB.

我正在使用数据源资源管理器视图,但是当我尝试创建新的数据库连接时,有 MySQL、Oracle、Informix 的连接......但没有用于 MariaDB。

Can anyone help me?

谁能帮我?

回答by kumbo christian

If you need to create a database connection for MariaDB, you choose "Generic JDBC" and click Next.

如果需要为 MariaDB 创建数据库连接,请选择“Generic JDBC”并单击 Next。

In next window click on "new driver definition" button then choose "Generic JDBC Driver" from "Available driver templates"

在下一个窗口中单击“新驱动程序定义”按钮,然后从“可用驱动程序模板”中选择“通用 JDBC 驱动程序”

In "JAR List", add the Maria connector. You can get it from (https://downloads.mariadb.com/enterprise/152y-977s/connectors/java/connector-java-1.4.6/mariadb-java-client-1.4.6.jar). I used "mariadb-java-client-1.4.6.jar"

在“JAR 列表”中,添加 Maria 连接器。您可以从(https://downloads.mariadb.com/enterprise/152y-977s/connectors/java/connector-java-1.4.6/mariadb-java-client-1.4.6.jar)获取它。我使用了“mariadb-java-client-1.4.6.jar”

In "Properties", enter the following data

在“属性”中,输入以下数据

Connection URL: jdbc:mariadb://localhost:3306/database_name
Database Name: database_name
Driver Class: org.mariadb.jdbc.Driver

You can set User ID to empty and validate username and password of your database. Test if it connects.

您可以将用户 ID 设置为空并验证数据库的用户名和密码。测试是否连接。