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.
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.
Creating new Database and Granting Access to Other Users:
Issue below commands in mysql command prompt after logging through root user.
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.
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.