MySQL and phpMyAdmin are the go-to combo for managing databases in web projects.
Whether you're building something serious or just tinkering, self-hosting your own stack gives you full control — and it’s easier than you think.
In this guide, I’ll show you how to:
Install MySQL on Ubuntu
Secure your database
Set up phpMyAdmin
Add real uptime monitoring — so you know when something breaks
A fresh Ubuntu 22.04 server
sudo/root access
A domain name (optional, but recommended for phpMyAdmin)
10–15 minutes
Update your server:
sudo apt update && sudo apt upgrade -y
Install MySQL:
sudo apt install mysql-server -y
Secure your installation:
sudo mysql_secure_installation
Answer the prompts to remove anonymous users, disallow remote root login, etc.
Log in to MySQL:
sudo mysql
Then run:
CREATE DATABASE myapp_db;
CREATE USER 'myuser'@'localhost' IDENTIFIED BY 'strongpassword';
GRANT ALL PRIVILEGES ON myapp_db.* TO 'myuser'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Install required dependencies:
sudo apt install phpmyadmin php-mbstring php-zip php-gd php-json php-curl -y
During setup:
Choose Apache (if prompted)
Configure a MySQL application password
Enable extensions:
sudo phpenmod mbstring
sudo systemctl restart apache2
Now access it at:http://your-server-ip/phpmyadmin
Point a subdomain (like db.yourdomain.com
) to your server’s IP.
Then set up a reverse proxy (e.g. with NGINX) and secure it with HTTPS via Let’s Encrypt.
Protect access by:
Adding .htpasswd
authentication
Restricting by IP
Moving it to a non-obvious path (/mydbadmin
)
Congrats — your DB stack is running.
But what happens if it goes down?
💡 Don’t wait to find out the hard way. Add uptime monitoring now:
Create a free Garmingo Status account
Add a monitor for:
http(s)://yourdomain.com/phpmyadmin
Port 3306 (MySQL)
Your public IP (Ping monitor)
You’ll get:
Real-time alerts (Slack, Email, Telegram, etc.)
Public or private status pages
Downtime logs & SLA tracking
PDF uptime reports
🆓 100% free plan. No credit card. Instant peace of mind.
✅ Install MySQL
✅ Set up phpMyAdmin
🔒 Secure everything
📈 Monitor it with Garmingo Status
If your database goes down and no one's watching… is it really running?
Got an idea? Let us know