问题描述
我需要在DB Navigator插件中设置一个连接,以用于Mac(Snow Leopard)中的PhpStorm.它要求我了解实现Java.sql.Driver类的库路线.我只是不知道它在哪里.有建议吗?
推荐答案
说明
- 通过Menubar安装DB Navigator插件>>设置>>插件>> 可用tab
- 从此处下载MySQL JDBC连接器>> http://www.mysql.com/downloads/downloads/connector/connector/j/j/ /li>
- 将MySQL JDBC连接器解开为您选择的目录
- 重新启动phpstorm/webstorm
- 通过Menubar添加DB >> DB Navigator >>设置>>连接-TAB >> plus button
- 输入连接的参数(本地MySQL DB的可能条目请参见下文)
本地mysql db
的可能参数
- 名称:选择名称(Localhost)
- 描述:选择的其他信息(dbname)
- 驱动程序库:.jar文件的路径(这是步骤3中使用的目录)
- 驱动程序:首选驱动程序(很可能标准驱动程序会>> com.mysql.jdbc.driver)
- URL:带有JDBC参考的连接URL(例如: jdbc:mysql://localhost:3306/)
- 用户名:db选择的用户名(root)
- 密码:DB密码(root)
其他推荐答案
只需确保您添加 jdbc:mysql://在主机名之前.解决了我的问题.
jdbc:mysql://my-db-url.com
其他推荐答案
首先,您不需要安装第三方DB导航器插件,因为数据库功能可在phpstorm中获得,请参见Tools | Data Sources.
添加新数据源,它将允许选择数据库和驱动程序,并将自动下载所需的数据库驱动程序.
问题描述
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?
推荐答案
Instructions
- Install DB Navigator Plugin via menubar >> Settings >> Plugins >> Available-Tab
- Download MySQL jdbc connector from here >> http://www.mysql.com/downloads/connector/j/
- Unpack MySQL jdbc connector to a directory of your choice
- Restart PHPStorm / WebStorm
- Add a DB via menubar >> DB Navigator >> Settings >> Connection-Tab >> Plus-Button
- 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)
其他推荐答案
Just make sure you added jdbc:mysql:// before hostname. That solved my problem.
jdbc:mysql://my-db-url.com
其他推荐答案
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.