Web Hosting & VPS Tips

Unleash Your Server Potential with Expert Insights

Hosting provided by: Cloudways
Free to Try! Up to 40% Off!

Category: VPS Setup

Set up MySQL on an Ubuntu VPS with UFW protection—install with
apt update && apt install mysql-server
secure it via
mysql_secure_installation
(set root password like My$qlUbunt! remove test DBs) and start with
systemctl start mysql
Open port 3306 with
ufw allow 3306/tcp
restrict to an IP (e g your office) with
ufw allow from 192.168.1.100 to any port 3306
and enable UFW (ufw enable) Test with
mysql -u root -p
—expect a prompt On DigitalOcean this secures phpMyAdmin access ensuring uptime—verify connections with
netstat -tulnp | grep 3306
expecting \"mysqld\" listening

Back to All Tips