Linux, Web Server & Database

Install MySQL on VPS

Get MySQL installed, secured and ready for your application on a fresh VPS.

The Problem

A default MySQL install leaves the root account insecure, no dedicated database or user for your application, and none of the memory/connection settings tuned for your VPS's actual resources.

About this problem

MySQL's own installer doesn't walk you through the basic hardening steps (removing anonymous users, disabling remote root login, setting a strong root password) unless you run the included secure-installation script afterwards, and plenty of fresh installs skip that step entirely.

This typically comes up when setting up a new application server that needs its own database, separate from a managed or shared hosting database.

What's Included

What's NOT Included

How It Works

  1. Install the MySQL server package and start the service.
  2. Run mysql_secure_installation to remove anonymous users, test databases and disable remote root login.
  3. Create a dedicated database and a user scoped only to that database, not global privileges.
  4. Adjust my.cnf settings (buffer pool size, max connections) to match the VPS's available RAM.
  5. Test a connection using the new credentials from the application side, not just the MySQL CLI.

In practice: you buy the service, send over whatever access or details the job needs, I investigate and do the work, and you confirm it's resolved before we call it done.

Frequently Asked Questions

Should I use MySQL or MariaDB?
They're closely compatible, and for most applications either works fine — MariaDB is the default on several distros now, while MySQL is still what many hosting panels and tutorials assume, so it often comes down to what your application specifically recommends.
Why can't I connect to MySQL from my application?
Common causes are the user not having privileges on the specific database, MySQL only listening on localhost when your app needs remote access, or a firewall blocking the port — each needs checking separately.
Is it safe to use the root MySQL user for my application?
No — a dedicated user with privileges limited to just its own database is standard practice, so a compromised application can't touch other databases on the same server.
What does mysql_secure_installation actually do?
It removes the anonymous user account, disables remote root login, removes the test database, and reloads privilege tables — all steps a fresh MySQL install leaves undone by default.
How much RAM should I allocate to MySQL?
As a rough starting point, innodb_buffer_pool_size is often set to around 50-70% of available RAM on a dedicated database server, but it should leave enough headroom for the OS and any other running services.
Can I install MySQL and run a website on the same small VPS?
Yes for small-to-moderate traffic, as long as memory settings are tuned sensibly so MySQL and the web server aren't competing for the same limited RAM.
Please note: the price shown applies to a standard case matching the description above. Every situation is different, and if your request falls outside the normal scope of this service, I will explain this before doing any additional chargeable work. I will never silently turn a small job into an expensive project.
Running into an issue with a service you've already bought, or unsure which one fits your problem? Message me directly on WhatsApp — no ticket system, no bot.