How to configure MySQL data source for PhpStorm? - mysql

I have a legacy PHP project using MySQL. PhpStorm discovers that there are MySQL queries inside the project, and asks me to provide a data source for them.
This opens this window:
Yet I am totally confused on how to provide the credentials to my MySQL database. I expected a mask to enter my MySQL host, username, password and target database name. Yet I cannot find this in here.
How to configure a MySQL data source in PhpStorm?

To create a new source for your projet, click on the green "+" icon and select mysql in the list of drivers. It should display fields for database info including username and password.

You have to click on the green +, top left corner.
Then Click on MySQL, and you will be able to enter DB informations.

Related

Sublime Text : SQLTools Connection without specifying a database

I'm configuring Sublime to run my SQL queries, I installed the SQLTools package and successfully connected to my host, however I need to specify a database and I don't want that, I want it to connect to all databases on that host , this in order for the autocomplete to work for all the databases, since if I connect to a specific db, the autocomplete only works for the Tables of that db.
enter image description here
When trying to omit the database attribute, the connection is not created correctly, so I suppose the database parameter must be there and I would like to know if there is a possibility of specifying that it take all.
PD: This is the way SQLTools is setting by default.
enter image description here

Unable to connect Power BI with Mysql Database

I am trying to make a connection of PowerBI with Mysql database. I am not able to find the server name required for connection.
I was able to make a connection with Postgres database. I am not able to find the server name required for connecting to Mysql Database and it just says validating credentials and asks me to install some dependencies which I have already installed multiple times.
Any help would be much appreciated! Thanks in advance.
Hey there Dan Christian, to connect Power BI Desktop with
MysqlDatabase Server please follow the below steps, we have faced a
similar issue and when we followed
these steps it worked:
1.Press "Windows" key and search for "Services", in the "Services" search for "MYSQL80"(or any version that you maybe working on) and
make sure it is running otherwise right click it and "Start" the
service. [Click here][1]
2.Now , Open Mysql workbench on the authorization screen you can see the ip address where Mysql is running on.[click here][2]
3.In my case it's "localhost:3306" "3306" is default port for Mysql.[Click here][1]
4.it is configurable we can change the host and port its running on by changing them in the Mysql settings which is the small "Tool" icon.
5.After the steps 1 to 4 are done proceed with PowerBI.
6.After opening PowerBI Desktop, Goto Home.
7.Click the "Get Data" Button.[click here][1]
8.Then click "More".
9.A window pops up in which there are multiple options to select on the left.
10.Select "Database".[click here][1]
11.Search for "Mysql Database".
12.A small window with the fields "Server" and "Database" is shown.
13.In the "Server" field fill "localhost:3306" if you haven't configured it to something else in the steps 1 to 5. [click here][1]
14.For the sake of connection use the default database provided by Mysql "sakila".
15.After this a window pops with the options Database and Windows, select "Database" and fill in your credentials default username is "root" and enter your password.[click here][1]
16.Then click "connect" if the credentials are right a window with all the tables in sakila database.
17.Now you have succesfully connected to Mysql Database in PowerBI repeat the steps to use desired databases.
[1]: https://i.stack.imgur.com/c41lh.png [2]:
https://i.stack.imgur.com/BR3yH.png

How to connect IntelliJ with local MySQL?

I have been struggling to learn how the localhost MySQL and IntelliJ to connect and program a database related task. Is that Possible? If yes, how to achieve it?
Connecting to a local instance is essentially the same as connecting to a remote instance of MySQL. Just substitute either localhost, or 127.0.0.1 in place of the IP address you would use normally.
To add a new database connection (called a data source in IntelliJ), open the Database window View -> Tool Windows -> Databases, then click the + sign and select Data Source and then MySQL from the sub-menu. The defaults for the MySQL connection should for a local install of MySQL.
To open a connection, right click on your new data source and select Open Console.
Official IntelliJ Documentation - Managing Data Sources
As of Community version 2017.2, the DB Browser does not come bundled with the IDE (at least not on my last two installations). In order to activate it, you should navigate in the IDE in **File->Settings->Plugins->Browse repositories and select "Database" from the dropdown menu. From there you can install the Database Navigator. After the installation has been successful, you should restart the IDE. Then you can select **View->Tool windows->DB Browser.
In recent versions of Idea Community (about 2017.3, but I am not sure) there is no Database tool available anymore, only in Idea Ultimate [1]. Yet worse, the plugin Database Navigator that would fit here to solve this problem is not compatible anymore, at least not with 2018.3 [2].
Uninstalling Idea right now, unfortunately.
[1] https://intellij-support.jetbrains.com/hc/en-us/community/posts/360000411990-Database-option-not-available-under-View-Tool-Windows-in-Intellij-v2018-1-Community-Edition-
[2] https://intellij-support.jetbrains.com/hc/en-us/community/posts/360001759260-Dan-Cioacas-Database-Navigator-plugin-v3-0-8222-0-is-incompatible-with-latest-IntelliJ-IDEA-2018-3
To add a new database connection (called a data source in IntelliJ), open the Database window View -> Tool Windows -> Databases, then click the + sign and select Data Source and then MySQL from the sub-menu. The defaults for the MySQL connection should for a local install of MySQL.
To open a connection, right click on your new data source and select Open Console.
to download Drivers click on "Download missing Drivers" in bottom of the window.
if you want to add JDBC and connect other database vendor like workbench projects (instead of using intelliJ Consol) just follow the steps bellow :
Using JDBC drivers #
Create a connection to a database with a JDBC driver #
If you cannot find a name of a database vendor in the list of data sources, download a JDBC driver for the database management system (DBMS), and create a connection in IntelliJ IDEA. With the JDBC driver, you can connect to DBMS and start working.
In the Database tool window (View | Tool Windows | Database), click the Data Source Properties icon.
In the Data Sources and Drivers dialog, click the Add icon (+) and select Driver and Data Source.
Click the User Driver link.
In the Driver files pane, click the Add icon and select Custom JARs.
Navigate to the JAR file of the JDBC driver, select it, and click
OK.
In the Class field, specify the value that you want to use for the
driver.
Click Apply.
Return to the created data source connection.
Specify database connection details. Alternatively, paste the JDBC URL in the URL field.
To set an empty password, right-click the Password field and select Set empty.
To ensure that the connection to the data source is successful,
click Test Connection.
For more information read the official answer of Jetbrains in following link :
Configuring database connections
https://www.jetbrains.com/help/idea/configuring-database-connections.html#Configuring_database_connections.xml
For anyone who is having trouble connecting IntelliJ Community Edition with MySQL in 2021.
(In IntelliJ Ultimate Database connectivity is supported by default and you can follow the steps shown in the previous answers. However IntelliJ Community Edition does not support it by Default).
Here is what you have to do:
Install "Database Navigator" Plugin. (Settings->Plugins->Marketplace->Search Database
Navigator and install)
Open DB Browser Tab (next to the button that opens/closes Project Window) -> Click Options logo
-> '+' -> Fill the Database fields (Name, host, Port, DB Name, User and Password).
Download the MySQL Java Connector
by searching google for 'java connector mysql'.
Go to File->
Project Structure -> Modules-> Dependencies. Click the '+' on the right side and select 'JARs or directories'.
Navigate and find the Java connector you just downloaded (the file
looks like this: mysql-connector-java-8.0.26.jar). Click apply
and in the project window, under External Libraries, you will see
the .jar file.
For WebStorm you need plugin "database-navigator"
https://plugins.jetbrains.com/plugin/1800-database-navigator

I get "Open SQL Script" upon MySQL startup (in Workbench)

I have 3 connections configured in the MySQL Workbench and lately as soon as I run the workbench I get this "Open SQL Script" dialog.
Steps:
1) Right click MySQL Notifier (1.1.4)
2) Click on "SQL Editor..."
3) Expected: Workbench Home (1 tab open)
Actual result: the tab for the 3rd connection is automatically open and on top of that I get this "Open SQL Script" dialog.
Additionally I would love to be able to change the default connection that opens, but I could not find any of this anywhere.
Help is appreciated! Thanks,
Simon
Take a closer look where you are clicking in MySQL Notifier. For each instance MySQL Workbench (and hence MySQL Notifier) found there's a separate menu entry which you can use to open the application for. The notifier is just trying to help you to get quicker to some standard work. If you just want to open MySQL Workbench then don't use the notifier. Create a shortcut for it and put in a good place instead.
Update
In order to clarify look at this image:
As you can see there's more than one "SQL Editor..." entry (one for each connection in MySQL Workbench). But even if you only have one connection, the menu entry "SQL Editor..." is meant to open ... well... the SQL editor. In addition it asks for an SQL file you may want to open. That's just how it is designed. If you don't want that click Cancel. There's no dedicated menu entry to just open MySQL Workbench with the home screen. If you want that better place a shortcut to the application on your desktop.
Regarding a "default connection": there's no such thing as a default connection. You can pass in a connection name on the command line if you want to open a specific connection. You can use the shortcut you can create and add the parameter "-query " to it.

ColdFusion Database settings

Where is a place to look for db settings in ColdFusion? I would like to connect to the db via sequel pro.
Is there a DSN set up on the server that the CF is using? That can be used to connect to the database, and would specify the name, password, database and a bit more. That's accessed through the CFAdministrator page, not in the CF code itself. Only the DSN name is used in the code.
Edit: In the CF admin page, go to the Data & Services tab, then choose Data Sources. That is where the list of DSNs exist. Select a data source to see the connection information. The password is masked.