Prerequisites
Before installing MySQL, make sure you have:
- SSH access to your VPS
- Root or sudo privileges
Install MySQL on Ubuntu/Debian
Connect to your VPS:
ssh hxroot@YOUR_SERVER_IP -p 22
apt update
apt install mysql-server -y
Secure MySQL Installation
mysql_secure_installation
Follow prompts to:
- Set root password
- Remove anonymous users
- Disallow remote root login
- Remove test database
- Reload privileges
Start and Enable MySQL
systemctl start mysql
systemctl enable mysql
Verify Installation
mysql --version
systemctl status mysql
✅ MySQL database has been installed.