MySQL Installation on Ubuntu

3 min read
Last updated at: Jul 27 2021

Developers Installation Prerequisite

MySQL 5.7 installation on ubuntu 18.04>>>>>>>>>>>>>>>>>>>>>>

$ sudo apt-get install mysql-server

$ sudo mysql -u root

mysql > SELECT User, Host, plugin FROM mysql.user;

mysql > ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'your password';

mysql> FLUSH PRIVILEGES;

 

MySQL 5.7 installation on ubuntu 20.04>>>>>>>>>>>>>>>>>>>>>>

$ sudo apt update

$ sudo apt install wget -y

$ sudo wget https://dev.mysql.com/get/mysql-apt-config_0.8.12-1_all.deb

$ sudo dpkg -i mysql-apt-config_0.8.12-1_all.deb

$ sudo apt-get update

$ sudo apt-cache policy mysql-server

$ sudo apt install -f mysql-community-client=5.7.34-1ubuntu18.04

$ sudo apt install -f mysql-client=5.7.34-1ubuntu18.04

$ sudo apt install -f mysql-community-server=5.7.34-1ubuntu18.04

$ sudo apt install -f mysql-server=5.7.34-1ubuntu18.04

$ mysql_secure_installation

$ sudo systemctl restart mysql