database 如何为 Jetbrains PHPStorm 和 WebStorm 配置 DB Navigator

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

How to configure DB Navigator for Jetbrains PHPStorm and WebStorm

databasephpstormpycharmwebstormnavigator

提问by R01010010

I need to set up a connection in the DB Navigator plugin for PHPStorm in a mac (snow leopard). It asks me for the route of a library that implements the java.sql.Driver class. I just don't have any idea of where is it. Any advice?

我需要在mac(雪豹)中为PHPStorm的DB Navigator插件设置连接。它询问我实现 java.sql.Driver 类的库的路径。我只是不知道它在哪里。有什么建议吗?

回答by Bruiser

Instructions

指示

  1. Install DB Navigator Plugin via menubar >> Settings >> Plugins >> Available-Tab
  2. Download MySQL jdbc connector from here >> http://www.mysql.com/downloads/connector/j/
  3. Unpack MySQL jdbc connector to a directory of your choice
  4. Restart PHPStorm / WebStorm
  5. Add a DB via menubar >> DB Navigator >> Settings >> Connection-Tab >> Plus-Button
  6. Enter the parameters for your connection (see below for possible entries for a local MySQL DB)
  1. 通过菜单栏>>设置>>插件>>可用选项卡安装DB Navigator插件
  2. 从这里下载 MySQL jdbc 连接器 >> http://www.mysql.com/downloads/connector/j/
  3. 将 MySQL jdbc 连接器解压到您选择的目录
  4. 重启 PHPStorm/WebStorm
  5. 通过菜单栏 >> DB Navigator >> Settings >> Connection-Tab >> Plus-Button 添加 DB
  6. 输入连接参数(有关本地 MySQL 数据库的可能条目,请参见下文)

Possible parameters for a local MySQL DB

本地 MySQL 数据库的可能参数

  • Name: name of choice (localhost)
  • Description: additional info of choice (dbname)
  • Driver Library: path to the .jar file (that is the directory used in step 3)
  • Driver: preferred driver (most likely the standard driver will do >> com.mysql.jdbc.Driver)
  • URL: connection URL with a jdbc reference (e.g.: jdbc:mysql://localhost:3306/)
  • UserName: db username of choice (root)
  • Password: db password of choice (root)
  • 名称:选择的名称(本地主机)
  • 描述:选择的附加信息(dbname)
  • 驱动程序库:.jar 文件的路径(即步骤 3 中使用的目录)
  • 驱动程序:首选驱动程序(很可能标准驱动程序会做 >> com.mysql.jdbc.Driver)
  • URL:带有 jdbc 引用的连接 URL(例如:jdbc:mysql://localhost:3306/
  • 用户名:选择的数据库用户名(root)
  • 密码:选择的db密码(root)

回答by Mladen Janjetovic

Just make sure you added jdbc:mysql://before hostname. That solved my problem.

只要确保在主机名之前添加了jdbc:mysql://。那解决了我的问题。

jdbc:mysql://my-db-url.com

回答by CrazyCoder

First of all, you don't need to install third-party DB Navigator plug-in, as database functionality is available in PhpStorm out of the box, see Tools| Data Sources.

首先,您不需要安装第三方 DB Navigator 插件,因为 PhpStorm 中提供了开箱即用的数据库功能,请参阅Tools| Data Sources.

Add new data source, it will allow to choose the database and the driver, and will download the required database drivers automatically.

添加新的数据源,将允许选择数据库和驱动程序,并自动下载所需的数据库驱动程序。

回答by Redee

Installed unpacked MySQL Connector J files here > c:\Program Files\MySQL\MySQL Connector J

在此处安装解压的 MySQL Connector J 文件 > c:\Program Files\MySQL\MySQL Connector J

And there need to us > mysql-connector-java-5.1.28-bin.jar

并且需要我们> mysql-connector-java-5.1.28-bin.jar

Copy to > c:\Documents and Settings[YOUR_COMP].WebIde70\config\jdbc-drivers\

复制到 > c:\Documents and Settings[YOUR_COMP].WebIde70\config\jdbc-drivers\

In MySQL Database connection choose Drivers >> MySQL >> click on PLUS and select

在 MySQL 数据库连接中选择 Drivers >> MySQL >> 点击 PLUS 并选择

> c:\Documents and Settings[YOUR_COMP]\.WebIde70\config\jdbc-drivers\mysql-connector-java-5.1.28-bin.jar

> c:\Documents and Settings[YOUR_COMP]\.WebIde70\config\jdbc-drivers\mysql-connector-java-5.1.28-bin.jar

Also need Database Support plug-in turn ON! (Settings >> IDE Settings >> Plugins)

还需要Database Support插件开启!(设置 >> IDE 设置 >> 插件)

p.s. Actually for PHPStorm 7

ps 实际上对于 PHPStorm 7

回答by Tharinda

Download mysql-connector-java-5.1.18-bin.jarfile and set Driver Library path for that jar file.

下载mysql-connector-java-5.1.18-bin.jar文件并为该 jar 文件设置驱动程序库路径。

Then the Intellij idea will automatically load the Driver which is com.mysql.jdbc.Driver.

然后 Intellij 的想法会自动加载驱动程序,即com.mysql.jdbc.Driver

Then set URL as jdbc:mysql://localhost:3306/

然后将 URL 设置为jdbc:mysql://localhost:3306/

Finally enter valid user name and a password.

最后输入有效的用户名和密码。

回答by Kabir Hossain

Clearly view this picture. I hope it may help you a little bit.

清楚地看到这张照片。我希望它可以帮助你一点点。

  1. There is a driver files missing error at below of this image, click this it will download required driver for you.

  2. Database: your database name.

  3. User : your database user name and password.
  4. Then click test connection.I hope it will give you successful message.
  1. 此图片下方存在驱动程序文件丢失错误,单击此按钮将为您下载所需的驱动程序。

  2. 数据库:您的数据库名称。

  3. 用户:您的数据库用户名和密码。
  4. 然后点击测试连接。我希望它会给你成功的信息。

enter image description here

在此处输入图片说明