How to install DataGrip in Ubuntu

To install DataGrip in Ubuntu 16.04

DataGrip is the multi-engine database environment. It supports MySQL, Oracle, Sybase, DB2, SQLite, HyperSQL, PostgreSQL, Microsoft SQL Server, Apache Derby and H2. Installation of DataGrip in Ubuntu is explained in this article.

Features

  • To analyse the DB
  • Executing queries
  • Quick coding assistance


To install DataGrip

Add java repository, by using the following command.

root@linuxhelp:~# add-apt-repository ppa:webupd8team/java
 Oracle Java (JDK) Installer (automatically downloads and installs Oracle JDK7 / JDK8 / JDK9). There are no actual Java files in this PPA.

More info (and Ubuntu installation instructions):
- for Oracle Java 7: http://www.webupd8.org/2012/01/install-oracle-java-jdk-7-in-ubuntu-via.html
- for Oracle Java 8: http://www.webupd8.org/2012/09/install-oracle-java-8-in-ubuntu-via-ppa.html

.
.
.

Important!!! For now, you should continue to use Java 8 because Oracle Java 9 is available as an early access release (it should be released in 2016)! You should only use Oracle Java 9 if you explicitly need it, because it may contain bugs and it might not include the latest security patches! Also, some Java options were removed in JDK9, so you may encounter issues with various Java apps. More information and installation instructions (Ubuntu / Linux Mint / Debian): http://www.webupd8.org/2015/02/install-oracle-java-9-in-ubuntu-linux.html
 More info: https://launchpad.net/~webupd8team/+archive/ubuntu/java
Press [ENTER] to continue or ctrl-c to cancel adding it

gpg: keyring `/tmp/tmpo4uxzk_6/secring.gpg'  created
gpg: keyring `/tmp/tmpo4uxzk_6/pubring.gpg'  created
gpg: requesting key EEA14886 from hkp server keyserver.ubuntu.com
gpg: /tmp/tmpo4uxzk_6/trustdb.gpg: trustdb created
gpg: key EEA14886: public key " Launchpad VLC"  imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
OK

Update the system by running the following command.

root@linuxhelp:~# apt-get update
Hit:1 http://in.archive.ubuntu.com/ubuntu xenial InRelease
Get:2 http://in.archive.ubuntu.com/ubuntu xenial-updates InRelease [95.7 kB]   
Get:3 http://security.ubuntu.com/ubuntu xenial-security InRelease [94.5 kB]    
Hit:4 http://ppa.launchpad.net/dhor/myway/ubuntu xenial InRelease              
Get:5 http://ppa.launchpad.net/webupd8team/java/ubuntu xenial InRelease [17.6 kB]
Hit:6 http://in.archive.ubuntu.com/ubuntu xenial-backports InRelease           
Get:7 http://in.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [328 kB]
Get:8 http://ppa.launchpad.net/webupd8team/java/ubuntu xenial/main amd64 Packages [2,844 B]
Get:9 http://ppa.launchpad.net/webupd8team/java/ubuntu xenial/main i386 Packages [2,844 B]
Get:10 http://in.archive.ubuntu.com/ubuntu xenial-updates/main i386 Packages [324 kB]
Get:11 http://ppa.launchpad.net/webupd8team/java/ubuntu xenial/main Translation-en [1,260 B]
Get:12 http://in.archive.ubuntu.com/ubuntu xenial-updates/main Translation-en [125 kB]
Get:13 http://in.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [300 kB]
Get:14 http://in.archive.ubuntu.com/ubuntu xenial-updates/universe i386 Packages [297 kB]
Fetched 1,588 kB in 6s (239 kB/s)                                              
Reading package lists... Done

Utilise the following command to install java.

root@linuxhelp:~# apt-get install java-common oracle-java8-installer
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  gsfonts-x11
Suggested packages:
  binfmt-support visualvm ttf-baekmuk | ttf-unfonts | ttf-unfonts-core
  ttf-kochi-gothic | ttf-sazanami-gothic ttf-kochi-mincho
  | ttf-sazanami-mincho ttf-arphic-uming
.
.
.
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/xjc to provide /usr/bin/xjc (xjc) in auto mode
Oracle JDK 8 installed
update-alternatives: using /usr/lib/jvm/java-8-oracle/jre/lib/amd64/libnpjp2.so to provide /usr/lib/mozilla/plugins/libjavaplugin.so (mozilla-javaplugin.so) in auto mode
Oracle JRE 8 browser plugin installed
Setting up gsfonts-x11 (0.24) ...

Accept the license agreement to proceed further.

DataGrip is an integrated tool for Database. Now install mysql by using the following command.

root@linuxhelp:~# apt-get install mysql-server mysql-client
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  libaio1 libhtml-template-perl mysql-client-5.7 mysql-client-core-5.7
  mysql-common mysql-server-5.7 mysql-server-core-5.7
.
.
.
.
update-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Setting up libhtml-template-perl (2.95-2) ...
Setting up mysql-client (5.7.12-0ubuntu1.1) ...
Setting up mysql-server (5.7.12-0ubuntu1.1) ...
Processing triggers for libc-bin (2.23-0ubuntu3) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for systemd (229-4ubuntu4) ...

Set the password for mysql server.

Check the mysql status by executing the following command.

root@linuxhelp:~# service mysql status
 mysql.service - MySQL Community Server
   Loaded: loaded (/lib/systemd/system/mysql.service  enabled  vendor preset: en
   Active: active (running) since Thu 2016-07-21 23:08:28 IST  1min 54s ago
 Main PID: 6586 (mysqld)
   CGroup: /system.slice/mysql.service
           ??6586 /usr/sbin/mysqld

Jul 21 23:08:27 linuxhelp systemd[1]: Starting MySQL Community Server...
Jul 21 23:08:28 linuxhelp systemd[1]: Started MySQL Community Server.
lines 1-9/9 (END)

Change the working directory by using the following command.

root@linuxhelp:~# cd /home/user1/Downloads/
Download “ datagrip”  from its official web site by using the following command.
root@linuxhelp:/home/user1/Downloads# wget https://download.jetbrains.com/datagrip/datagrip-2016.2.tar.gz
--2016-07-21 23:11:56--  https://download.jetbrains.com/datagrip/datagrip-2016.2.tar.gz
Resolving download.jetbrains.com (download.jetbrains.com)... 54.217.236.18
Connecting to download.jetbrains.com (download.jetbrains.com)|54.217.236.18|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://download-cf.jetbrains.com/datagrip/datagrip-2016.2.tar.gz [following]
--2016-07-21 23:11:56--  https://download-cf.jetbrains.com/datagrip/datagrip-2016.2.tar.gz
Resolving download-cf.jetbrains.com (download-cf.jetbrains.com)... 54.230.172.164, 54.230.172.113, 54.230.172.145, ...
Connecting to download-cf.jetbrains.com (download-cf.jetbrains.com)|54.230.172.164|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 164654275 (157M) [binary/octet-stream]
Saving to: ‘ datagrip-2016.2.tar.gz’ 

datagrip-2016.2.tar 100%[===================> ] 157.03M   342KB/s    in 4m 46s  

2016-07-21 23:16:44 (562 KB/s) - ‘ datagrip-2016.2.tar.gz’  saved [164654275/164654275]

Extract the downloaded package.

root@linuxhelp:/home/user1/Downloads# tar zxf datagrip-2016.2.tar.gz
root@linuxhelp:/home/user1/Downloads# ls
DataGrip-2016.2  datagrip-2016.2.tar.gz

Rename the extracted directory.

root@linuxhelp:/home/user1/Downloads# mv DataGrip-2016.2 datagrip

And copy the datagrip directory to " opt" directory.

root@linuxhelp:/home/user1/Downloads# cp &ndash R datagrip /opt/

change the ownership to “ root” using “ chown” command.

root@linuxhelp:/opt/# chown &ndash R root.root datagrip

Dive into the “ datagrip/bin/” directory using “ cd” command

root@linuxhelp:/opt/# cd datagrip/bin/
root@linuxhelp:/opt/datagrip/bin# ls
datagrip64.vmoptions  fsnotifier64     libyjpagent-linux64.so
datagrip.sh           fsnotifier-arm   libyjpagent-linux.so
datagrip.vmoptions    idea.properties  log.xml
fsnotifier            inspect.sh       product.png

Run the “ datagrip.sh” file by using “ sh” command.

root@linuxhelp:/opt/datagrip/bin# sh datagrip.sh

Click “ ok” to complete the installation.

Read all the terms and conditions. Then click Accept to continue further.

Select the preferred License type and click Evaluate.

Then accept license agreement for Datagrip.


Select your desired theme and click “ Next:Editor color themes"

Next select the preferred editor color themes and click " Next:IDE defaults"

Select the preferred database and set password.

Click panel view control icon and select “ data source” or select File-> datasource in menu bar.


Click “ +” (add) icon on the base panel. Select Data Source and choose the type of database you have added.

Data source and drive window appears. Enter the database user name and password. click Ok and then Apply.

Data base editor page opens as follows.

Now start to create or modify your Database.


A sample query for database creation.

Comment
kuba1996
Jun 29 2017
How to open DataGrip(next use after installing)?
Add a comment
FAQ
Q
Does DataGrip repeat the functionality of the database tools in other JetBrains IDEs?
A
Yes. All of DataGrip’s features are also available in other IDEs from JetBrains like IntelliJ IDEA, PhpStorm, PyCharm, RubyMine, as well as the upcoming Rider and Gogland.
Q
Is DataGrip available via JetBrains Toolbox as part of the “All Products” pack?
A
Yes, it is available both as a Single IDE and as part of “All Products.”
Q
What about data visualization, like graphs or pie-charts?
A
No there is no data visualization in DataGrip.
Q
What is the Purpose of using the Datagrip?
A
DataGrip is the multi-engine database environment. It supports MySQL, Oracle, Sybase, DB2, SQLite, HyperSQL, PostgreSQL, Microsoft SQL Server, Apache Derby and H2.
Q
How can I use DataGrip with SQL dialects that are not listed?
A
DataGrip can connect to any database which has a JDBC-driver. It means that you can connect to the database, see tables and other objects, and run queries. Special features of these kind of database are not supported and their syntax is not correctly highlighted.