How to Install & Configure MySQL Server in Ubuntu
The MySQL database server is one of the most popular open-source database servers
Follow the below Steps to install and configure
Type the following command to install MySQL server and client.
$sudo apt-get update
$sudo apt-get install mysql-server mysql-common mysql-client
Once installation complete it will ask to set mysql root user password
Configure Mysql server IP and port, Make the below entry on /etc/mysql/my.cnf
$sudo vim /etc/mysql/my.cnf
Restart the Mysql Service
$sudo /etc/init.d/mysql restart
You can check the service status using command
$sudo /etc/init.d/mysql status
or $sudo netstat -tap | grep mysql
Now Connect to Mysql server using below command
$sudo mysql -u root -p
Create a Sample Database and list all databases
mysql>create database tecgeeksdb;
mysql>show databases;
Create a user called rahul with password redhat@1 for same database:
first use the database for which you want to create user.
mysql> use tecgeeksdb;
mysql> grant all on tecgeeksdb.* to rahul@localhost identified by 'redhat@1';
mysql>flush privileges; ( to make the change effect )
Follow the below Steps to install and configure
Type the following command to install MySQL server and client.
$sudo apt-get update
$sudo apt-get install mysql-server mysql-common mysql-client
Once installation complete it will ask to set mysql root user password
Configure Mysql server IP and port, Make the below entry on /etc/mysql/my.cnf
$sudo vim /etc/mysql/my.cnf
Restart the Mysql Service
$sudo /etc/init.d/mysql restart
You can check the service status using command
$sudo /etc/init.d/mysql status
or $sudo netstat -tap | grep mysql
Now Connect to Mysql server using below command
$sudo mysql -u root -p
Create a Sample Database and list all databases
mysql>create database tecgeeksdb;
mysql>show databases;
Create a user called rahul with password redhat@1 for same database:
first use the database for which you want to create user.
mysql> use tecgeeksdb;
mysql> grant all on tecgeeksdb.* to rahul@localhost identified by 'redhat@1';
mysql>flush privileges; ( to make the change effect )
To Rest forgotten root password check our Post
How to Install & Configure MySQL Server in Ubuntu
Reviewed by TecGeeks News
on
April 16, 2016
Rating:
No comments: