> For the complete documentation index, see [llms.txt](https://agon.rlib.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://agon.rlib.io/setup/database.md).

# Database

Instructions for setting up your database storage method

## <mark style="color:red;">▸ Location</mark>

> &#x20;             <mark style="color:yellow;">**`addons\agon\agon.rlib`**</mark>

## <mark style="color:red;">▸ Required Fields</mark>

Once you have completed the installation of this addon. You must configure the addon to utilize your database credentials. You will need the following information:

<table data-header-hidden><thead><tr><th width="124"></th><th></th></tr></thead><tbody><tr><td><mark style="color:red;"><strong>host</strong></mark></td><td><p><br>The host for your MySQL database server. </p><p>This is usually an IP address.</p><p><br>Use <mark style="color:yellow;"><code>localhost</code></mark> if your mysql database runs on same server as your gmod server.<br></p></td></tr><tr><td><mark style="color:red;"><strong>user</strong></mark></td><td><br>Username for your MySQL connection<br></td></tr><tr><td><mark style="color:red;"><strong>pass</strong></mark></td><td><br>Password you have assigned to your mysql user<br></td></tr><tr><td><mark style="color:red;"><strong>name</strong></mark></td><td><br>Name of your database<br></td></tr><tr><td><mark style="color:red;"><strong>port</strong></mark></td><td><br>Port used to connect your gmod server with the MySQL server.<br>This is usually <mark style="color:yellow;"><code>3306</code></mark><br></td></tr><tr><td><mark style="color:red;"><strong>mode</strong></mark></td><td><p><br>Which mode you wish to use as the database storage method.</p><p><br><mark style="color:red;"><strong>Options:</strong></mark></p><ul><li><mark style="color:yellow;">sqlite</mark></li><li><mark style="color:yellow;">mysql</mark><br><br></li></ul><p>See <a href="#mode">Mode section</a> for more information.<br></p></td></tr></tbody></table>

## <mark style="color:red;">▸ Modes</mark>

You can select one of the following modes for your SQL engine:

<table data-header-hidden><thead><tr><th width="299"></th><th></th></tr></thead><tbody><tr><td><mark style="color:red;"><strong>sqlite</strong></mark></td><td>Included with Gmod</td></tr><tr><td><mark style="color:red;"><strong>mysqloo</strong></mark></td><td><a href="https://github.com/FredyH/MySQLOO/releases">Download</a></td></tr></tbody></table>

#### <mark style="color:yellow;">SQLite</mark>

This storage method is included with Garry's Mod. No further installs are required.

#### <mark style="color:yellow;">MySQL</mark>

Download the latest version from the link provided above. Place that file within the <mark style="color:red;">**`garrysmod/lua/bin/`**</mark> folder on your server. If the <mark style="color:yellow;">**`bin`**</mark> folder doesn't exist, please create it.

## <mark style="color:red;">▸ Tables</mark>

In the database config file, there will be variables at the bottom which relate to the database table names. Do **not** modify these unless you know what you are doing.

```json
"tables"
{
    "_prefix"       "agon"
    "users"         "players"
    "rlib"          "script"
}
```
