40

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?

Monodeep
  • 1,392
  • 1
  • 17
  • 39
R01010010
  • 5,670
  • 11
  • 47
  • 77

6 Answers6

95

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)
Bruiser
  • 11,767
  • 5
  • 34
  • 45
  • 2
    I had some trouble getting this figured out until I realized that my server is not listening on any sockets that could be reached from the outside internet. – Jeff Hines Dec 12 '12 at 00:57
  • i lost you from step 4, i installed db navigator from plugins, but how to open, i mean from where to open, any shortcut for it? – Sizzling Code Mar 13 '13 at 18:20
  • 3
    @SyedHaiderHassan after you installed DB Navigator plugin & restart PHPStorm, there should be a menu **DB Navigator** between *Window* and *Help* on the menubar – Rocco Mar 29 '13 at 03:50
  • @Rocoo: Thanks, restarting the program has been added as step 4 of the instructions – Bruiser Jul 03 '13 at 09:47
  • Using Oracle JDBC driver I don't get any options at all in the select driver dropdown. Anyone had the same problem? – Simon Bengtsson Feb 20 '14 at 12:04
  • for SQLite do most PHPStorm users just run the Firefox plugins to read them? Does PHPStorm have a SQLite compatible DBNavigator? – Erik Apr 29 '14 at 21:15
  • 1
    Thanks, that answer just helped me a lot. Thanks for contributing it Bruiser. – Pete Mancini Feb 09 '15 at 18:36
16

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

jdbc:mysql://my-db-url.com
Mladen Janjetovic
  • 13,844
  • 8
  • 72
  • 82
  • 1
    This also solves the "driver refused to create connection for this configuration. no failure information provided" error. – tozlu Feb 19 '15 at 12:28
8

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.

CrazyCoder
  • 389,263
  • 172
  • 990
  • 904
  • Thank you i found it and although i don't see the databases to explore at least i made the conection. Thank you again, i'll take a look. – R01010010 Sep 19 '11 at 10:13
0

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

Redee
  • 547
  • 5
  • 8
0

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.

Tharinda Wicky
  • 388
  • 4
  • 16
0

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.

enter image description here

Kabir Hossain
  • 2,865
  • 1
  • 28
  • 34