How to Connect a MySQL Database to Your Garry's Mod Server

Garry's Mod2 min readUpdated Oct 24, 2026

Gamemodes like DarkRP and many addons save their data in a MySQL database. This guide creates the database in the panel, installs the MySQLOO module and points your addon at the database.

Create the Database

Note the Connection Details

  • The database card shows the Host, Port, Database and Username. Each line has a copy button.
  • Click the eye icon next to Password to show it, or the copy button next to it to copy it.
  • You need these values in step 4. The panel adds a prefix to the database and user names, so copy them exactly as shown.

Install MySQLOO

  • Check your Game Branch under Game Settings, in the Advanced section.
  • For Public (32-bit), use gmsv_mysqloo_linux.dll.
  • For x86-64 (64-bit), use gmsv_mysqloo_linux64.dll.
  • Open Files and go to garrysmod/lua/bin/. Create the folders if they do not exist.
  • Click Upload and upload the module that matches your branch. Large files upload faster over FTP.
  • If you change the branch later, swap the module as well.

Fill In the Addon Config

  • Open the config file of your gamemode or addon. For DarkRP this is the MySQL file in its config folder.
  • Enter the host, username, password and database name from step 2.
  • Keep the quotes around each value.
  • Click Save.

Restart and Check the Console

  • Open the Console page and press Restart.
  • Watch the console while the server starts.
  • A connection error means one of the values is wrong. Open the config again and compare each value with the Databases page.
  • A module error means the file in garrysmod/lua/bin/ does not match your Game Branch.

Good to Know

  • Copy the password with care. A space at the start or end of the value stops the login.
  • Import data. To load an existing database file, see how to import an SQL file via HeidiSQL.
  • Keep the config private. It holds your database password, so only share server access with people you trust.

Finished

Your server is connected to its MySQL database. Protect your data with automatic backups.

Did this solve your problem?

Still stuck?

Our support team actually knows the games we host. Open a ticket and we will figure it out together.

Open a ticket