Ubuntu

Installing and Configuring DataGrip on Ubuntu 20.04 LTS

In this article, I am going to show you how to install and configure DataGrip IDE on Ubuntu 20.04 LTS. So, let’s get started.

Installing Ubuntu Make

You can easily install DataGrip IDE using Ubuntu Make on Ubuntu 20.04 LTS. Ubuntu Make is available in the official package repository of Ubuntu 20.04 LTS.

First, update the APT package repository cache as follows:

$ sudo apt update

Now, install Ubuntu Make with the following command:

$ sudo apt install ubuntu-make

To confirm the installation, press Y and then press <Enter>.

Ubuntu Make should be installed.

Now, run the following command to check if the umake command is available:

$ umake --version

Installing DataGrip:

You can easily install DataGrip using the following umake command:

$ umake ide datagrip

By default, DataGrip IDE should be installed in the path $HOME/.local/umake/ide/datagrip. If you want, you can change it. But the default path is good enough. You don’t have to change it.

Once you’re done, press <Enter>.

Ubuntu Make should download DataGrip from the internet.

At this point, DataGrip should be installed.

Now, add execute permission to the DataGrip desktop file as follows:

$ chmod +x ~/.local/share/applications/jetbrains-datagrip.desktop

Finally, reboot your computer for the changes to take effect.

$ sudo reboot

Once your computer boots, you can access DataGrip from the Application Menu of Ubuntu 20.04 LTS.

Uninstalling DataGrip:

If you want to uninstall DataGrip IDE, run the following command:

$ umake --remove ide datagrip

DataGrip should be removed from your Ubuntu 20.04 LTS machine.

Upgrading DataGrip:

If there is any new version of DataGrip available, DataGrid IDE will notify you. You can upgrade DataGrip IDE from the IDE itself.

Ubuntu Make does not provide any method of upgrading DataGrip IDE. If you badly want to upgrade DataGrip using Ubuntu Make, you can use a little trick. Just remove DataGrip and install it again using Ubuntu Make.

To remove DataGrip, run the following command:

$ umake --remove ide datagrip

To install DataGrip again, run the following command:

$ umake ide datagrip

Initial Configuration of DataGrip:

First, start DataGrip from the Application Menu of Ubuntu 20.04 LTS.

Now, check I confirm that I have read and accept the terms of this User Agreement and click on Continue.

Now, you may or may not choose to share data with JetBrains.

DataGrip is being loaded.

Now, you have to activate DataGrip IDE. You can buy licenses from JetBrains.

If you want to try out DataGrip before buying licenses, select Evaluate for free and click on Evaluate. You will get 30 days trial with access to all the features of DataGrip.

Now, select Darcula (dark UI) or Light (light UI) UI theme depending on your preference and click on Next: Database Options.

Now, select your default SQL dialect (for autocompletion of SQL statements) and a script directory (optional). A script directory is just like a project directory. You can keep your database SQL files there and access them from DataGrip.

Once you’re done, click on Start using DataGrip.

You should see the following Tip of the Day window. If you don’t want daily tips on various features of DataGrip, check Don’t show tips and click on Close.

DataGrip main window should be displayed.

Basic Usage of DataGrip IDE:

In this section, I am going to show you how to use DataGrip. I will connect to a MariaDB database and show you how to manage it using DataGrip.

First, you have to add a data source to DataGrip. To do that, from the Database tab, click on the + button, and select Data Source > MariaDB.

You may have missing driver files. Click on Download to download them.

Now, type in your database Host, Port, User, Password, Database name and click on Test Connection.

If you’re unable to connect to the database, you will see error messages.

You should see a tick mark if everything goes well.

Once you see a tick mark, click on OK.

You should be connected to the database. A database console should be opened. You can type in any SQL statement here and you will get autocompletion as you type in.

Once you type in a SQL statement, put your cursor on the line and press <Ctrl> + <Enter> to execute the SQL statement. The output should be displayed in the bottom as you can see in the screenshot below.

Databases are also known as schemas in DataGrip. I have a test database here.

To create a table, right click (mouse) on your database, and click on New > Table.

A new window should be opened.

Now, type in a table name. Click on the + button to add a new column to the table.

Now, you can type in a column name, data type and a default value for the column. You can check some extra column options as well.

You can add as many columns as you want.

To delete a column, select it and click on the button.

You can also change the position of the columns using the up and down arrow keys.

You can manage table keys from the Keys tab.

You can manage table Indexes from the Indices tab.

You can manage the foreign keys of the table from the Foreign Keys tab.

Once you’re done, click on the Execute button.

The users table should be created.

Now, double click on the users table to open the data editor. To add a new row, click on the + button.

Now, double click on the column and type in the column value. The <generated> column values will be automatically generated.

You can add as many rows as you want. Once you’re done, click on the marked icon to save the changes to the database.

As you can see, the ids are automatically generated.

Configuring DataGrip:

To configure DataGrip, go to File > Settings.

You can change the UI Theme from the Appearance & Behavior > Appearance tab.

You can change the editor Color Scheme from the Editor > Color Scheme tab.

You can change the editor font and font settings from the Editor > Font tab. You can also check Enable font ligatures to enable extra font symbols.

You can enable word wrapping from the Editor > General tab. To do that, check Soft-wrap these files and add the file extensions (i.e. *.sql) for which you want to enable word wrapping. Separate each file extensions using a semicolon (;) as follows.

You can also search for DataGrip settings using the search box as marked in the screenshot below.

Once you’re done configuring DataGrip, click on OK for the changes to take effect.

So, that’s how you install, use and configure DataGrip IDE. Thanks for reading this article.

About the author

Shahriar Shovon

Freelancer & Linux System Administrator. Also loves Web API development with Node.js and JavaScript. I was born in Bangladesh. I am currently studying Electronics and Communication Engineering at Khulna University of Engineering & Technology (KUET), one of the demanding public engineering universities of Bangladesh.