Home Cloud Serevrs Set Up a MySQL Server on a Windows VPS

Set Up a MySQL Server on a Windows VPS

Last updated on Feb 13, 2025

MySQL is a powerful, open-source database management system used for web applications, game servers, and enterprise software. This guide will show you how to install and configure MySQL on a Windows Server VPS.


📌 Prerequisites

  • A Windows Server VPS (2016, 2019, or 2022) from VolticHost

  • Administrator access

  • At least 2GB RAM (4GB+ recommended for production servers)


1️⃣ Download and Install MySQL Server

  1. Go to the official MySQL Community Edition download page:
    👉 https://dev.mysql.com/downloads/installer/

  2. Download the MySQL Installer for Windows (Full or Web).

  3. Run the installer and select "Server Only".

  4. Click Next and install MySQL Server.

MySQL is now installed!


2️⃣ Configure MySQL Server

  1. Open MySQL Installer → Click MySQL ServerReconfigure.

  2. Select Standalone MySQL Server and click Next.

  3. Choose "Development Machine" (for small VPS) or "Server Machine" (for production).

  4. Set Port 3306 (default) and click Next.

  5. Select Use Strong Password Encryption.

  6. Set a Root Password (Store it securely!).

  7. Click Next, then Execute to apply changes.

Your MySQL server is configured!


3️⃣ Allow MySQL Through Windows Firewall

  1. Open Windows Defender Firewall (Win + R, type wf.msc, press Enter).

  2. Click Advanced SettingsInbound RulesNew Rule.

  3. Select Port → Click Next.

  4. Choose TCP and enter 3306 (default MySQL port).

  5. Click Next, select Allow the connection, and click Next again.

  6. Apply the rule to Domain, Private, and Public networks.

  7. Name the rule MySQL Port 3306 and click Finish.

Your MySQL server is now accessible!


4️⃣ Test MySQL Connection

  1. Open Command Prompt (Admin).

  2. Connect to MySQL:

    mysql -u root -p
    
  3. Enter your MySQL root password.

  4. If successful, you will see:

    Welcome to the MySQL monitor... mysql>
    

Your MySQL server is running!


5️⃣ (Optional) Allow Remote MySQL Connections

By default, MySQL only allows local connections. To enable remote access:

  1. Open MySQL Command Line:

    mysql -u root -p
    
  2. Allow remote connections:

    ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'yourpassword'; FLUSH PRIVILEGES;
    
  3. Open my.ini file (default location: C:\ProgramData\MySQL\MySQL Server X.X\my.ini) and find:

    bind-address = 127.0.0.1
    

    Change it to:

    bind-address = 0.0.0.0
    
  4. Restart MySQL Service:

    net stop mysql net start mysql
    

Your MySQL server now allows remote connections!


6️⃣ Secure Your MySQL Server

  1. Create a New Database User (Avoid Using Root):

    CREATE USER 'voltichost'@'%' IDENTIFIED BY 'StrongPassword123!'; GRANT ALL PRIVILEGES ON *.* TO 'voltichost'@'%' WITH GRANT OPTION; FLUSH PRIVILEGES;
    
  2. Enable Automatic Backups (Recommended for production servers).

  3. Keep MySQL Updated using the MySQL Installer.


🎉 Conclusion

You've successfully installed and configured MySQL on a Windows VPS! Your database server is now ready for web applications, game servers, or enterprise use. 🚀

For further assistance, contact VolticHost Support.