How to configure DB Navigator for Jetbrains PHPStorm and WebStorm

你。 提交于 2019-12-09 04:00:50

问题


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?


回答1:


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)

Possible parameters for a local MySQL DB

  • 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)



回答2:


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

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



回答3:


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.

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




回答4:


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

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

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

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

> 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)

p.s. Actually for PHPStorm 7




回答5:


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

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

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

Finally enter valid user name and a password.




回答6:


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.



来源:https://stackoverflow.com/questions/7434742/how-to-configure-db-navigator-for-jetbrains-phpstorm-and-webstorm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!