Install MySQL in Ubuntu
What is a Database?
Database is an organized collection of data stored electronically and managed by a software categorized as Database Management System (DBMS). DBMS software assists the user to perform CRUD operation(Create, Read, Update and Delete) on data. Apart from that DBMS also helps user in control data access. Database is categorized as Relational and Non-Relational Database but not limited to.
MySQL is a Relational Database Management System which uses SQL.
SQL is a Structured Query Language is used to perform database operation.
Before installing MySQL be clear on the purpose of installation.
MySQL server allows user to host multiple database and provides query interface.
MySQL client allows user to connect to the MySQL server to use the query interface.
Not everyone may need MySQL Server.
Install MySQL client
sudo apt-get install mysql-client
Install MySQL server
Note that installing mysql-server will also install mysql-client no need to install it seperately.
sudo apt-get install mysql-server
To check MySQL installation
mysql --version
To connect to mysql server enter into root access
sudo mysqlOr you can also use the below commands
sudo bash
Then,
mysql
Then you can start creating users and databases as desired.
Create User
create user 'cg'@'localhost' identified by 'password';
Note : This user can only be accessed from 'localhost' as constrained while creating the user.
To quit
exit
Authenticate using the created user
Kudos ! You have successfully created a user.
Comments
Post a Comment