Step 1 — Installing MySQL
On Ubuntu 20.04, you can install MySQL using the APT package repository.
sudo apt update
Then install the mysql-server package:
sudo apt install mysql-server
Step 2 — Configuring MySQL
Change the root user password with following command. first enter into mysql and then execute the query:
sudo mysql
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'your_password';
Revert to root user password to default mysql password is:
ALTER USER 'root'@'localhost' IDENTIFIED WITH auth_socket;
Step 3
Make your mysql accessible remotely for your Sql bench software. For doing that , open the file using your preferred editor. I am using VI, there are a lot more options like nano, gedit etc.
sudo vi /etc/mysql/mysql.conf.d/mysqld.cnf
In that file, look for the line:
bind-address = 127.0.0.1
Change that line to:
bind-address = 0.0.0.0
Save and close the file. Restart the MySQL service with:
sudo systemctl restart mysql
or
sudo service mysql restart