Download latest apt-config package from mysql and install it: https://dev.mysql.com/downloads/repo/apt/ Make sure you provide the latest release(focal/buster) during apt-package installation.
sudo apt update
sudo apt install mysql-server
sudo mysql_secure_installation Option 1: Use legacy password mode
In Ubuntu systems running MySQL 5.7 (and later versions), the root MySQL user is set to authenticate using the auth_socket plugin by default rather than with a password. This allows for some greater security and usability in many cases, but it can also complicate things when you need to allow an external program (e.g., phpMyAdmin) to access the user.
In order to use a password to connect to MySQL as root, you will need to switch its authentication method from auth_socket to mysql_native_password.
That's why During installation choose legacy password mode (native_authentication_method).
Option 2: Use caching_sha2_password (more secured)
$> sudo mysql
mysql> SELECT user,authentication_string,plugin,host FROM mysql.user;
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'password';
mysql> FLUSH PRIVILEGES;
mysql> SELECT user,authentication_string,plugin,host FROM mysql.user;Finally you're good to go alhamdulillah. Check if MySQL is running:
service mysql status
mysql -u root -p #in order to loginAs we already have latest apt repository for MySQL, we'll be able to install latest MySQL workbench alhamdulillah.
sudo apt-get install mysql-workbench-community