DEV Community

Shaikh Al Amin
Shaikh Al Amin

Posted on

Install and configure mysql in ubuntu 20.04

Please follow step by step command

sudo apt update
sudo apt install mysql-server
Enter fullscreen mode Exit fullscreen mode

After installation please follow below steps:

sudo mysql
Enter fullscreen mode Exit fullscreen mode

Now update the native plugin for root user

USE mysql;
Enter fullscreen mode Exit fullscreen mode
UPDATE user SET plugin='mysql_native_password' WHERE User='root';
Enter fullscreen mode Exit fullscreen mode
FLUSH PRIVILEGES;
Enter fullscreen mode Exit fullscreen mode

Now change the password using below commands:

ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password_here';
Enter fullscreen mode Exit fullscreen mode

Now restart your mysql service

sudo service mysql restart
Enter fullscreen mode Exit fullscreen mode

Run below command to connect mysql workbench to work correctly

sudo snap connect mysql-workbench-community:password-manager-service
Enter fullscreen mode Exit fullscreen mode
sudo snap connect mysql-workbench-community:ssh-keys
Enter fullscreen mode Exit fullscreen mode

Top comments (0)