MySQL Installation
Remote server connection from Termius. Run this command to identify the server's OS:
cat /etc/os-release
The server OS is Ubuntu, so from now on the commands to install MySQL are meant for Ubuntu only.
- Update the package list
sudo apt update
- Install MySQL Server
sudo apt install -y mysql-server
- Start MySQL
sudo systemctl start mysql
- Enable MySQL on boot
sudo systemctl enable mysql
- Run the security script
sudo mysql_secure_installation
The script will ask you to set a root password, remove anonymous users, and disable remote root login. Answer Y to all.
- Verify MySQL version
mysql --version
- Connect to MySQL
sudo mysql
- Verify the installation — inside the MySQL shell run:
SHOW DATABASES;
If you see information_schema, mysql, performance_schema, and sys, the installation is all done!