How to Install MySQL in Ubuntu Server?
Hi,
Today, i will let you know example of how to install mysql in ubuntu. We will look at example of how to install mysql in ubuntu 20.04 using terminal. i explained simply about ubuntu install mysql server example. let’s discuss about install mysql in ubuntu server.
In this post, i will give you simple list of commands how to install mysql server in ubuntu linux server. so let's see simple terminal command for install mysql in ubuntu ubuntu 21.10, ubuntu 21.04, ubuntu 20.04, ubuntu 18.04 and ubuntu 16.04.
Install MySQL on Ubuntu
Update Local Package:
sudo apt update
Install MySQL Server:
sudo apt install mysql-server
you can see terminal layout as bellow:
Access MySQL:
Now you can access mysql by using mysql command:
sudo mysql
OR
mysql -u root
you can see terminal layout as bellow:
MySQL Status:
you can check status of mysql server
systemctl status mysql.service
Create User on MySQL:
you can create new user for mysql by using following query:
sudo mysql
CREATE USER 'root_new'@'localhost' IDENTIFIED BY 'rootnewpassword';
GRANT ALL PRIVILEGES ON * . * TO 'root_new'@'localhost';
FLUSH PRIVILEGES;
I hope it can help you....
Hardik Savani
I'm a full-stack developer, entrepreneur and owner of ItSolutionstuff.com. I live in India and I love to write tutorials and tips that can help to other artisan. I am a big fan of PHP, Laravel, Angular, Vue, Node, Javascript, JQuery, Codeigniter and Bootstrap from the early stage. I believe in Hardworking and Consistency.
We are Recommending you
- How to Install Apache Web Server on Ubuntu Server?
- How to Connect SSH using ppk File Ubuntu?
- How to Connect to a Remote Server using SSH on Ubuntu?
- How to Upgrade PHP Version from 7.4 to 8 in Ubuntu?
- How to Export Mysql Database using Command Line in Ubuntu?
- How to Import Database in Mysql using Command Line in Ubuntu?
- How to Upgrade PHP Version from 7.3 to 7.4 in Ubuntu?
- How to Enable Apache mod_rewrite Module in Ubuntu?
- How to Increase Upload File Size Limit PHP in Ubuntu?
- How to Upgrade Node.js Version in Ubuntu?
- How to Enable Rewrite Mode for Apache in Ubuntu?