MySQL VPS - Getting Started Guide

MySQL VPS - Getting Started Guide

Your MySQL VPS based on Ubuntu 24.04 comes fully configured - MySQL 8.4 LTS is installed with the root password you specified during order. phpMyAdmin is included for web-based database management.

Software Included

Component Version
Ubuntu24.04 LTS
MySQL8.4 LTS (Oracle APT)
Apache2.4
PHP8.3
phpMyAdmin5.2
Certbotlatest
Fail2Banlatest

Step 1 - Your Credentials

Log in to your client panel and open your VPS service details. Find the IP address and root password (for SSH).

phpMyAdmin login:

  • Username: root
  • Password: the MySQL Root Password you entered during the order

Step 2 - Access phpMyAdmin

phpMyAdmin is available immediately after your VPS is created:

http://your.server.ip/phpmyadmin

Log in with username root and the MySQL Root Password from Step 1.

With phpMyAdmin you can create databases, run SQL queries, import/export data and manage users without using the command line.


Step 3 - Connect to MySQL Remotely

MySQL is configured to accept remote connections. You can connect from any application or tool:

mysql -h your.server.ip -u root -p

Connection details for database GUI tools (MySQL Workbench, DBeaver, HeidiSQL, etc.). Note: Port 3306 is MySQL protocol, not HTTP - it cannot be opened in a browser. Use a database client or the command above.

Parameter Value
Hostyour.server.ip
Port3306
Usernameroot
PasswordMySQL Root Password from order

Note: MySQL accepts connections from any IP address. Create databases and users via phpMyAdmin or the command line.


Step 4 - Enable SSL for phpMyAdmin (Optional)

If you have a domain pointing to this server, you can enable HTTPS for phpMyAdmin with a free Let's Encrypt certificate. Connect via SSH:

ssh root@your.server.ip
/opt/setup/get-ssl.sh db.yourdomain.com

The script will verify DNS, obtain a certificate and configure Apache for HTTPS automatically. After completion, phpMyAdmin is available at https://db.yourdomain.com/phpmyadmin.

Note: Make sure your domain's A record points to the server IP before running the script. SSL is optional - phpMyAdmin works fine over HTTP with IP address access.


What's Pre-Configured

  • Remote access: MySQL accepts connections from any IP on port 3306 (MySQL protocol, not HTTP)
  • InnoDB buffer pool: Automatically tuned to 50% of available RAM on first boot
  • Performance schema: Disabled on VMs with less than 2 GB RAM to save resources
  • Security: Fail2Ban protects SSH and phpMyAdmin from brute-force attacks
  • PHP uploads: 64 MB max file size (for phpMyAdmin imports)

Database Management

Creating Additional Databases

You can create additional databases via phpMyAdmin or SSH:

mysql -u root -p

CREATE DATABASE newdb CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'newuser'@'%' IDENTIFIED BY 'strong_password';
GRANT ALL PRIVILEGES ON newdb.* TO 'newuser'@'%';
FLUSH PRIVILEGES;

Import and Export

Via phpMyAdmin: Use the Import/Export tabs - supports SQL, CSV, and other formats. Max upload size is 64 MB.

Via command line:

# Export
mysqldump -u root -p your_database > backup.sql

# Import
mysql -u root -p your_database < backup.sql

For large databases (over 64 MB), use the command line instead of phpMyAdmin.


Post-Installation

Fail2Ban - Brute-Force Protection

Your server comes with Fail2Ban pre-configured to protect both SSH and phpMyAdmin from brute-force attacks.

Rule Max Attempts Ban Duration
SSH5 failed logins10 minutes
phpMyAdmin5 failed logins1 hour

Useful commands:

# Check banned IPs
fail2ban-client status phpmyadmin
fail2ban-client status sshd

# Unban an IP
fail2ban-client set phpmyadmin unbanip 1.2.3.4

If you accidentally lock yourself out, connect via VNC console in your client panel and unban your IP.

MySQL Performance Tuning

InnoDB buffer pool is automatically set to 50% of RAM on first boot. To check the current value:

mysql -u root -p -e "SHOW VARIABLES LIKE 'innodb_buffer_pool_size';"

To adjust manually, edit /etc/mysql/mysql.conf.d/99-tuning.cnf and restart MySQL:

systemctl restart mysql

Server Credentials

MySQL root password is stored in /root/.mysql_credentials.

Updates

MySQL and the OS don't update automatically. To update manually:

apt update && apt upgrade -y

Troubleshooting

Problem Solution
Can't connect to MySQL remotely Check that port 3306 is not blocked by firewall. Verify the user has '%' host (not 'localhost')
phpMyAdmin shows login error Verify your MySQL password. If you changed it, use the new one. Root credentials are in /root/.mysql_credentials
phpMyAdmin import fails (file too large) Max upload is 64 MB. For larger files, use mysql -u root -p dbname < file.sql via SSH
MySQL won't start Check logs: journalctl -u mysql -n 50. Common cause: disk full (df -h /)
Forgot MySQL root password SSH in and check /root/.mysql_credentials
Blocked by Fail2Ban Use VNC console in your client panel to unban your IP
Can't connect via SSH Check that port 22 is not blocked. Try VNC console as a fallback


Was this article helpful?

mood_bad Dislike 0
mood Like 0
visibility Views: 28