MySQL Installation On Ubuntu 1


Mysql installation on Ubuntu:

In this post we will discuss about MySQL Installation and configuration on Ubuntu machine using apt package repository.

Issue below commands in the same order as given below to install MySQL on Ubuntu.

Below is the snapshot of above install command.

MySQL Installation

Start MySQL:

For First run, we need to start mysql server with root access and need to create some databases or tables and should grant permissions to other users on those newly created instances.

Issue below command from terminal and provide root user password on Ubuntu machine. It is not MySQL password, it is our root user password on Ubuntu.

mysql root

Creating new Database and Granting Access to Other Users:

Issue below commands in mysql command prompt after logging through root user.

mysql create db

Database Population:

As in the above section, we have granted all privileges to all other users, now we can directly login to MySQL without root access and perform DDL or DML operations.

In the below, we are creating emp table under TestDB database and inserting values into emp table and retrieving the results back from emp table. Below are the commands to perform these actions.

mysql ddl

Creation of Dedicated User for MySQL:

In this blog, we use MySQL for hive local metastore setup and also for testing SQOOP import and export functionality from other relational databases. So, it is better to have dedicated user id (mysql_usr) for MySQL access under mysql_grp in ubuntu.

We can follow below command in the same sequence to add a new user mysql_usr to new group mysql_grp.

mysql user


Profile photo of Siva

About Siva

Senior Hadoop developer with 4 years of experience in designing and architecture solutions for the Big Data domain and has been involved with several complex engagements. Technical strengths include Hadoop, YARN, Mapreduce, Hive, Sqoop, Flume, Pig, HBase, Phoenix, Oozie, Falcon, Kafka, Storm, Spark, MySQL and Java.

Leave a comment

Your email address will not be published. Required fields are marked *


Review Comments
default image

I am a plsql developer. Intrested to move into bigdata.

Neetika Singh ITA Hadoop in Dec/2016 December 22, 2016

.