To install MySQL 5.7 on Ubuntu 16.04, follow these steps:
- Add the MySQL repository to the system:
wget https://dev.mysql.com/get/mysql-apt-config_0.8.10-1_all.deb
sudo dpkg -i mysql-apt-config_0.8.10-1_all.deb
- Update the package list:
sudo apt-get update
- Install the MySQL server package:
sudo apt-get install mysql-server-5.7
- Start the MySQL service:
sudo systemctl start mysql
- Verify the MySQL installation:
mysql -u root -p
- Secure the MySQL installation:
sudo mysql_secure_installation
- Test the MySQL installation:
mysql -u root -p
mysql> SHOW DATABASES;
This will install and configure MySQL 5.7 on your Ubuntu 16.04 server.