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.
URL for Connection:- The connection URL for the mysql database is jdbc:mysql://localhost:3306/mydb ('mydb' is the name of 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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With