Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mysql Connection with Phpstorm IDE

Tags:

php

phpstorm

jdbc

For those of you who are familiar with Phpstorm I am using version 2.0.1 as writing this question.

I am on a Mac using MAMP. I tried to connect my database with Phpstorm but it is a bit confusing.

I went to tools -> data sources when I press + to add and choose db datasource it wants me to enter a "jdbc://" URL to the database.

The whole time until now I've been using /Applications/MAMP/tmp/mysql/mysql.sock.

How do I get the db to connect with this socket thing? The software is amazing but confusing at times.

like image 373
Exploit Avatar asked Apr 15 '11 06:04

Exploit


People also ask

What is JDBC URL for MySQL?

URL for Connection:- The connection URL for the mysql database is jdbc:mysql://localhost:3306/mydb ('mydb' is the name of database).

Can't connect to the database?

Check your connection properties It can be an IP address 127.0. 0.1 or a domain name localhost. Database: A name of the database to which you want to connect. You can find the database name in the settings of your database server, or you can ask your database administrator.

Can I use PyCharm for MySQL?

With the plugin, you can query, create and manage databases. Databases can work locally, on a server, or in the cloud. The plugin supports MySQL, PostgreSQL, Microsoft SQL Server, SQLite, MariaDB, Oracle, Apache Cassandra, and others.


2 Answers

On the top part of the add DB connection window choose MySQL, then click for download.

Then you can use the connection string jdbc:mysql://localhost:3306/databasename. The connection string format is also contained in the autocomplete of the input box.

like image 102
Alex Avatar answered Sep 23 '22 00:09

Alex


I found this article useful: http://pro-cosmos.blogspot.com/2011/03/phpstorm-mysql.html

I successfully configured phpstorm to work with mysql but I used "jdbc:mysql://localhost:3306 as url.

like image 42
Maksim Kotlyar Avatar answered Sep 22 '22 00:09

Maksim Kotlyar