Hostxpeed
Login Get Started →
Getting Started

How to Install MySQL on VPS

3 min read
21 views
Jun 10, 2026

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.

Was this article helpful?