[{"data":1,"prerenderedAt":132},["ShallowReactive",2],{"header-games":3,"i-heroicons:server-stack-16-solid":61,"article-how-to-connect-a-database-to-your-fivem-server-en":66,"help-game-articles-fivem-en":96,"game-info-article-fivem":111,"i-heroicons:chevron-right-20-solid":117,"i-heroicons:user-circle-20-solid":120,"i-heroicons:clock-20-solid":122,"i-heroicons:calendar-days-20-solid":124,"i-heroicons:chevron-down-20-solid":126,"i-heroicons:wrench-screwdriver-20-solid":128,"i-heroicons:arrow-right-20-solid":130},{"promoCode":4,"total":5,"featured":6},"SUMMER26",42,[7,15,22,28,33,39,44,49,56],{"slug":8,"name":9,"icon":10,"hasIcon":11,"badge":12,"basePrice":13,"link":14},"minecraft","Minecraft","https:\u002F\u002Fcdn.doomhosting.com\u002Ficons\u002Fminecraft.png",true,"Most Popular",1,"\u002Fminecraft-server-hosting",{"slug":16,"name":17,"icon":18,"hasIcon":11,"badge":19,"basePrice":20,"link":21},"hytale","Hytale","https:\u002F\u002Fcdn.doomhosting.com\u002Ficons\u002Fhytale.png","",6,"\u002Fhytale-server-hosting",{"slug":23,"name":24,"icon":25,"hasIcon":11,"badge":26,"basePrice":20,"link":27},"palworld","Palworld","https:\u002F\u002Fcdn.doomhosting.com\u002Ficons\u002Fpalworld.png",null,"\u002Fpalworld-server-hosting",{"slug":29,"name":30,"icon":31,"hasIcon":11,"badge":26,"basePrice":20,"link":32},"rust","Rust","https:\u002F\u002Fcdn.doomhosting.com\u002Ficons\u002Frust.png","\u002Frust-server-hosting",{"slug":34,"name":35,"icon":36,"hasIcon":11,"badge":26,"basePrice":37,"link":38},"valheim","Valheim","https:\u002F\u002Fcdn.doomhosting.com\u002Ficons\u002Fvalheim.png",5,"\u002Fvalheim-server-hosting",{"slug":40,"name":41,"icon":42,"hasIcon":11,"badge":26,"basePrice":20,"link":43},"satisfactory","Satisfactory","https:\u002F\u002Fcdn.doomhosting.com\u002Ficons\u002Fsatisfactory.png","\u002Fsatisfactory-server-hosting",{"slug":45,"name":46,"icon":47,"hasIcon":11,"badge":26,"basePrice":20,"link":48},"enshrouded","Enshrouded","https:\u002F\u002Fcdn.doomhosting.com\u002Ficons\u002Fenshrouded.png","\u002Fenshrouded-server-hosting",{"slug":50,"name":51,"icon":52,"hasIcon":11,"badge":53,"basePrice":54,"link":55},"terraria","Terraria","https:\u002F\u002Fcdn.doomhosting.com\u002Ficons\u002Fterraria.png","New Update",4,"\u002Fterraria-server-hosting",{"slug":57,"name":58,"icon":59,"hasIcon":11,"badge":26,"basePrice":54,"link":60},"project-zomboid","Project Zomboid","https:\u002F\u002Fcdn.doomhosting.com\u002Ficons\u002Fproject-zomboid.png","\u002Fproject-zomboid-server-hosting",{"left":62,"top":62,"width":63,"height":63,"rotate":62,"vFlip":64,"hFlip":64,"body":65},0,16,false,"\u003Cpath fill=\"currentColor\" d=\"M5.354 2a2 2 0 0 0-1.857 1.257l-.338.845Q3.565 4 4 4h8q.436 0 .84.102l-.337-.845A2 2 0 0 0 10.646 2z\"\u002F>\u003Cpath fill=\"currentColor\" fill-rule=\"evenodd\" d=\"M2 13a2 2 0 0 1 2-2h8a2 2 0 1 1 0 4H4a2 2 0 0 1-2-2m10.75 0a.75.75 0 1 1-1.5 0a.75.75 0 0 1 1.5 0M9 13.75a.75.75 0 1 0 0-1.5a.75.75 0 0 0 0 1.5M4 5.5a2 2 0 1 0 0 4h8a2 2 0 1 0 0-4zm8 2.75a.75.75 0 1 0 0-1.5a.75.75 0 0 0 0 1.5M9.75 7.5a.75.75 0 1 1-1.5 0a.75.75 0 0 1 1.5 0\" clip-rule=\"evenodd\"\u002F>",{"id":67,"game_slug":68,"slug":69,"category":70,"title":71,"description":72,"content":73,"keywords":26,"author_name":74,"author_role":75,"is_featured":64,"published_at":76,"allSlugs":77,"author":82,"date":76,"lastUpdated":83,"game":84,"dateFormatted":86,"lastUpdatedFormatted":86,"imageDims":87},"c993cdae-41d6-4c77-9453-9582ff038f68","fivem","how-to-connect-a-database-to-your-fivem-server","Configuration","How to Connect a Database to Your FiveM Server","Create a MySQL database in the DoomHosting panel, point oxmysql at it from server.cfg, and import your ESX or QBCore schema on your FiveM server.","## How to connect a database to your FiveM server\n\nEvery roleplay framework worth running on FiveM stores its data in MySQL: characters, jobs, vehicles, inventories, bank balances. Your DoomHosting FiveM server includes a MySQL database slot you create yourself in the panel's **Databases** tab, and connecting it takes one line in `server.cfg`. This guide covers creating the database, building the connection string oxmysql expects, adding it to the config, and importing an ESX or QBCore schema.\n\n## What you need\n\n- A FiveM server on DoomHosting that already boots. If it does not start yet, set the license key first: [how to get a FiveM license key](\u002Fhelp\u002Farticles\u002Fhow-to-get-a-fivem-license-key).\n- oxmysql, the resource every modern framework uses to talk to MySQL. ESX and QBCore both ship with it.\n- A MySQL client on your PC if you plan to import a framework schema. [HeidiSQL](https:\u002F\u002Fwww.heidisql.com\u002F) (Windows) and [DBeaver](https:\u002F\u002Fdbeaver.io\u002F) (all platforms) are both free.\n\n## Create the database in the panel\n\n1. Open [your game servers](\u002Fpanel\u002Fgame-servers) and click your FiveM server.\n2. In the section nav, under **Advanced**, open **Databases**.\n3. Click **New database**, type a short name (letters, numbers and underscores only), and confirm.\n\nWe create the database and a matching user with a generated password. The name gets a prefix automatically, so a database you call `esx` ends up as something like `s1708_esx`, and the user looks like `u1708_esxdemo`.\n\n![The Databases tab in the DoomHosting panel showing a FiveM database with its host, username and password](https:\u002F\u002Fcdn.doomhosting.com\u002Fhelp\u002Ffivem\u002Fdatabases-tab.webp)\n\nThe row shows three credential chips. **Host** is the database address including its port, **Username** is the generated user, and **Password** is hidden until you click the eye icon. Click a chip to copy its value. Two buttons sit on the right: **New password** rotates the password (anything still using the old one stops working immediately), and the trash icon deletes the database and all of its data permanently.\n\n![The New database dialog in the DoomHosting panel with a name typed in](https:\u002F\u002Fcdn.doomhosting.com\u002Fhelp\u002Ffivem\u002Fcreate-database-dialog.webp)\n\nThe card header counts your slots, for example `1 of 1 databases used`. One slot covers a normal ESX or QBCore setup, since a framework and all of its resources share a single database. Contact support if your build genuinely needs a second one.\n\n## Get your connection string\n\noxmysql reads one convar, `mysql_connection_string`, and accepts two formats:\n\n```cfg\nset mysql_connection_string \"mysql:\u002F\u002Fu1708_esxdemo:YourPassword@203.0.113.10:3306\u002Fs1708_esx\"\nset mysql_connection_string \"user=u1708_esxdemo;password=YourPassword;host=203.0.113.10;port=3306;database=s1708_esx\"\n```\n\nFill the four values straight from the Databases tab: the user from **Username**, the password from **Password**, the database name from the row title, and the host from **Host**. The Host chip already contains the port in `address:port` form. In the URI format you paste it as-is after the `@`. In the key and value format you split it at the colon, address into `host=` and port into `port=`.\n\n**Use the second format.** Passwords we generate mix letters and digits with symbols from the set `! @ = . + ^`, and oxmysql documents `; , \u002F ? : @ & = + $ #` as reserved inside a connection string. A password containing `@`, `=` or `+` breaks the `mysql:\u002F\u002F` URI silently: the parser reads part of your password as the hostname and the connection fails with credentials that are perfectly valid. The `user=...;password=...` form has no such parsing trap.\n\n## Add it to server.cfg\n\n1. Open the **Files** tab and click `server.cfg` to edit it in the browser.\n2. Put the connection string above every resource line, then start oxmysql before your framework:\n\n```cfg\nset mysql_connection_string \"user=u1708_esxdemo;password=YourPassword;host=203.0.113.10;port=3306;database=s1708_esx\"\n\nensure oxmysql\nensure es_extended\n```\n\n3. Save the file, then restart the server from the top of the panel. Convars are read once at boot, so an edit does nothing until the server restarts.\n\n![Editing server.cfg in the panel Files tab with the mysql_connection_string line at the top](https:\u002F\u002Fcdn.doomhosting.com\u002Fhelp\u002Ffivem\u002Fserver-cfg-connection-string.webp)\n\nTwo things to leave alone. Our startup rewrites the `endpoint_add_tcp` and `endpoint_add_udp` lines to your allocated port on every boot, so there is no point editing them. And treat `server.cfg` as a secret file: it now holds your database password next to your license key, so never paste it into a Discord support channel without blanking both.\n\nIf you turned on txAdmin from the **Enable txAdmin** chip on Overview, FXServer no longer runs `\u002Fhome\u002Fcontainer\u002Fserver.cfg` directly. txAdmin owns the boot and runs the server from its own data folder, `\u002Fhome\u002Fcontainer\u002FtxData`, so edit the `server.cfg` inside the deployment folder there, or use the CFG editor built into txAdmin itself. You reach the web panel with **Open txAdmin** on Overview.\n\n## Install oxmysql\n\nCheck `resources` first. ESX and QBCore recipes almost always include oxmysql already, and a second copy causes a resource name conflict rather than a faster server.\n\nIf it is missing, download the latest release from the [oxmysql repository](https:\u002F\u002Fgithub.com\u002Foverextended\u002Foxmysql), unzip it, and upload the `oxmysql` folder into your `resources` directory from the Files tab. Then add `ensure oxmysql` above your framework resources as shown above. If your build still carries `mysql-async` or `ghmattimysql`, delete them: oxmysql provides their exports, and running both at once produces duplicate query handlers.\n\nThe [oxmysql documentation](https:\u002F\u002Foverextended.dev\u002Fdocs\u002Foxmysql) covers the extras, including `set mysql_debug true` to print every query to the console and `set mysql_slow_query_warning 150` to flag slow ones.\n\n## ESX and QBCore notes\n\nBoth frameworks query through oxmysql, so a single connection string serves the framework and every resource on top of it. What neither does for you is create its tables. You import those yourself:\n\n1. Install [HeidiSQL](https:\u002F\u002Fwww.heidisql.com\u002F) or [DBeaver](https:\u002F\u002Fdbeaver.io\u002F) on your PC.\n2. Create a new MySQL or MariaDB connection with the **Host** address and its port, plus the **Username** and **Password** from the Databases tab. The user we create is allowed to connect from any address, so a client on your home connection works without extra setup.\n3. Select your database, open the framework's `.sql` file, and run it.\n\nFor ESX, that is the `es_extended` SQL file plus whatever each addon ships. See the [ESX documentation](https:\u002F\u002Fdocs.esx-framework.org\u002Fen). For QBCore, import the `qb-core` dump first, then the per resource files, as described in the [QBCore documentation](https:\u002F\u002Fdocs.qbcore.org\u002Fqbcore-documentation). Import the schema before the first boot with the framework enabled, otherwise the console fills with missing table errors on startup.\n\nOne thing worth knowing about backups: panel backups archive your server files, not the MySQL database. Export a `.sql` dump from your client before a big framework update or a wipe.\n\n## Common issues\n\n**`Failed to connect` or access denied on boot.** Nine times out of ten the string still says `localhost`. There is no MySQL server inside your game container, so the host has to be the address from the Databases tab.\n\n**Credentials are correct but authentication keeps failing.** The password contains `@`, `=` or `+` and you are using the `mysql:\u002F\u002F` format. Switch to the `user=...;password=...;host=...` form. Clicking **New password** may also hand you a cleaner password, but the second format is the reliable fix.\n\n**Resources start before the convar is set.** oxmysql connects when it starts, so the `set mysql_connection_string` line has to sit above `ensure oxmysql`. Use `set`, not `sets` or `setr`: those publish the value to every connecting player.\n\n**Nothing changed after editing the config.** Restart the server. A live server never rereads `server.cfg`.\n\n**Unknown table or column errors.** The connection works and the schema was never imported, or it was imported into the wrong database. Confirm in HeidiSQL that the tables exist inside your prefixed database, not in a second one you created by hand.\n\n**You edited server.cfg but txAdmin is enabled.** txAdmin runs its own copy under `\u002Fhome\u002Fcontainer\u002FtxData`. Edit that one, or the file you changed is simply never read.\n\n**The Databases tab says databases are not available.** Your server has no database slot. Contact support and we will look at the service.\n\n## Next steps\n\nYour framework now has a home for its data. If you are still setting the server up, the license key guide is here: [how to get a FiveM license key](\u002Fhelp\u002Farticles\u002Fhow-to-get-a-fivem-license-key). Full plan details, hardware and pricing live on the [FiveM server hosting](\u002Ffivem-server-hosting) page.","Magnus","Game Server Expert","2026-07-25T10:00:00+00:00",{"da":78,"de":79,"en":69,"pl":80,"sv":81},"sadan-forbinder-du-en-database-til-din-fivem-server","wie-verbindest-du-eine-datenbank-mit-deinem-fivem-server","jak-podlaczyc-baze-danych-do-serwera-fivem","sa-ansluter-du-en-databas-till-din-fivem-server",{"name":74,"role":75},"2026-07-25T19:18:25.385298+00:00",{"slug":68,"name":85},"Fivem","Jul 25, 2026",{"https:\u002F\u002Fcdn.doomhosting.com\u002Fhelp\u002Ffivem\u002Fdatabases-tab.webp":88,"https:\u002F\u002Fcdn.doomhosting.com\u002Fhelp\u002Ffivem\u002Fcreate-database-dialog.webp":91,"https:\u002F\u002Fcdn.doomhosting.com\u002Fhelp\u002Ffivem\u002Fserver-cfg-connection-string.webp":94},{"width":89,"height":90},1600,1059,{"width":92,"height":93},896,484,{"width":89,"height":95},1223,[97,108],{"id":98,"game_slug":68,"slug":99,"category":100,"title":101,"description":102,"content":26,"keywords":26,"author_name":74,"author_role":75,"is_featured":11,"published_at":103,"author":104,"date":103,"lastUpdated":105,"game":106,"dateFormatted":107},"298606ae-c9e3-47f4-ba24-32f3ad3c1b44","how-to-get-a-fivem-license-key","Getting Started","How to get a FiveM license key","Step-by-step guide to creating a free FiveM (CFX) license key at portal.cfx.re and pasting it into your DoomHosting panel so your FXServer can start.","2026-06-08T11:46:51.879+00:00",{"name":74,"role":75},"2026-06-08T11:46:51.674294+00:00",{"slug":68,"name":85},"Jun 8, 2026",{"id":67,"game_slug":68,"slug":69,"category":70,"title":71,"description":72,"content":26,"keywords":26,"author_name":74,"author_role":75,"is_featured":64,"published_at":76,"author":109,"date":76,"lastUpdated":83,"game":110,"dateFormatted":86},{"name":74,"role":75},{"slug":68,"name":85},{"slug":68,"name":112,"icon":113,"cardImage":114,"description":115,"status":116},"FiveM","https:\u002F\u002Fcdn.doomhosting.com\u002Ficons\u002Ffivem.png","https:\u002F\u002Fcdn.doomhosting.com\u002Fgames\u002Ffivem.webp","FiveM is the community-built multiplayer mod for Grand Theft Auto V that turns Los Santos into your own custom city — host roleplay servers running ESX or QBCore, racing leagues, drift meets, deathmatch arenas, or whatever wild game mode you can script in Lua. Run servers with up to 256 slots and total control over rules, jobs, and economy. Rent a dedicated FiveM server from DoomHosting for one-click txAdmin, instant setup, full FTP, DDoS protection, and 24\u002F7 expert support.","active",{"left":62,"top":62,"width":118,"height":118,"rotate":62,"vFlip":64,"hFlip":64,"body":119},20,"\u003Cpath fill=\"currentColor\" fill-rule=\"evenodd\" d=\"M8.22 5.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L11.94 10L8.22 6.28a.75.75 0 0 1 0-1.06\" clip-rule=\"evenodd\"\u002F>",{"left":62,"top":62,"width":118,"height":118,"rotate":62,"vFlip":64,"hFlip":64,"body":121},"\u003Cpath fill=\"currentColor\" fill-rule=\"evenodd\" d=\"M18 10a8 8 0 1 1-16 0a8 8 0 0 1 16 0m-5.5-2.5a2.5 2.5 0 1 1-5 0a2.5 2.5 0 0 1 5 0M10 12a5.99 5.99 0 0 0-4.793 2.39A6.48 6.48 0 0 0 10 16.5a6.48 6.48 0 0 0 4.793-2.11A5.99 5.99 0 0 0 10 12\" clip-rule=\"evenodd\"\u002F>",{"left":62,"top":62,"width":118,"height":118,"rotate":62,"vFlip":64,"hFlip":64,"body":123},"\u003Cpath fill=\"currentColor\" fill-rule=\"evenodd\" d=\"M10 18a8 8 0 1 0 0-16a8 8 0 0 0 0 16m.75-13a.75.75 0 0 0-1.5 0v5c0 .414.336.75.75.75h4a.75.75 0 0 0 0-1.5h-3.25z\" clip-rule=\"evenodd\"\u002F>",{"left":62,"top":62,"width":118,"height":118,"rotate":62,"vFlip":64,"hFlip":64,"body":125},"\u003Cg fill=\"currentColor\">\u003Cpath d=\"M5.25 12a.75.75 0 0 1 .75-.75h.01a.75.75 0 0 1 .75.75v.01a.75.75 0 0 1-.75.75H6a.75.75 0 0 1-.75-.75zM6 13.25a.75.75 0 0 0-.75.75v.01c0 .414.336.75.75.75h.01a.75.75 0 0 0 .75-.75V14a.75.75 0 0 0-.75-.75zM7.25 12a.75.75 0 0 1 .75-.75h.01a.75.75 0 0 1 .75.75v.01a.75.75 0 0 1-.75.75H8a.75.75 0 0 1-.75-.75zM8 13.25a.75.75 0 0 0-.75.75v.01c0 .414.336.75.75.75h.01a.75.75 0 0 0 .75-.75V14a.75.75 0 0 0-.75-.75zM9.25 10a.75.75 0 0 1 .75-.75h.01a.75.75 0 0 1 .75.75v.01a.75.75 0 0 1-.75.75H10a.75.75 0 0 1-.75-.75zm.75 1.25a.75.75 0 0 0-.75.75v.01c0 .414.336.75.75.75h.01a.75.75 0 0 0 .75-.75V12a.75.75 0 0 0-.75-.75zM9.25 14a.75.75 0 0 1 .75-.75h.01a.75.75 0 0 1 .75.75v.01a.75.75 0 0 1-.75.75H10a.75.75 0 0 1-.75-.75zM12 9.25a.75.75 0 0 0-.75.75v.01c0 .414.336.75.75.75h.01a.75.75 0 0 0 .75-.75V10a.75.75 0 0 0-.75-.75zM11.25 12a.75.75 0 0 1 .75-.75h.01a.75.75 0 0 1 .75.75v.01a.75.75 0 0 1-.75.75H12a.75.75 0 0 1-.75-.75zm.75 1.25a.75.75 0 0 0-.75.75v.01c0 .414.336.75.75.75h.01a.75.75 0 0 0 .75-.75V14a.75.75 0 0 0-.75-.75zM13.25 10a.75.75 0 0 1 .75-.75h.01a.75.75 0 0 1 .75.75v.01a.75.75 0 0 1-.75.75H14a.75.75 0 0 1-.75-.75zm.75 1.25a.75.75 0 0 0-.75.75v.01c0 .414.336.75.75.75h.01a.75.75 0 0 0 .75-.75V12a.75.75 0 0 0-.75-.75z\"\u002F>\u003Cpath fill-rule=\"evenodd\" d=\"M5.75 2a.75.75 0 0 1 .75.75V4h7V2.75a.75.75 0 0 1 1.5 0V4h.25A2.75 2.75 0 0 1 18 6.75v8.5A2.75 2.75 0 0 1 15.25 18H4.75A2.75 2.75 0 0 1 2 15.25v-8.5A2.75 2.75 0 0 1 4.75 4H5V2.75A.75.75 0 0 1 5.75 2m-1 5.5c-.69 0-1.25.56-1.25 1.25v6.5c0 .69.56 1.25 1.25 1.25h10.5c.69 0 1.25-.56 1.25-1.25v-6.5c0-.69-.56-1.25-1.25-1.25z\" clip-rule=\"evenodd\"\u002F>\u003C\u002Fg>",{"left":62,"top":62,"width":118,"height":118,"rotate":62,"vFlip":64,"hFlip":64,"body":127},"\u003Cpath fill=\"currentColor\" fill-rule=\"evenodd\" d=\"M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06\" clip-rule=\"evenodd\"\u002F>",{"left":62,"top":62,"width":118,"height":118,"rotate":62,"vFlip":64,"hFlip":64,"body":129},"\u003Cg fill=\"currentColor\">\u003Cpath fill-rule=\"evenodd\" d=\"M14.5 10a4.5 4.5 0 0 0 4.284-5.882c-.105-.324-.51-.391-.751-.15L15.34 6.66a.45.45 0 0 1-.493.11a3 3 0 0 1-1.618-1.616a.455.455 0 0 1 .11-.494l2.694-2.692c.24-.241.174-.647-.15-.752a4.5 4.5 0 0 0-5.873 4.575c.055.873-.128 1.808-.8 2.368l-7.23 6.024a2.724 2.724 0 1 0 3.837 3.837l6.024-7.23c.56-.672 1.495-.855 2.368-.8q.144.01.291.01M5 16a1 1 0 1 1-2 0a1 1 0 0 1 2 0\" clip-rule=\"evenodd\"\u002F>\u003Cpath d=\"M14.5 11.5q.26 0 .514-.022l3.754 3.754a2.5 2.5 0 0 1-3.536 3.536l-4.41-4.41l2.172-2.607c.052-.062.147-.138.342-.196a2.3 2.3 0 0 1 .777-.067q.192.012.387.012M6 4.586l2.33 2.33a.5.5 0 0 1-.08.09L6.8 8.214L4.586 6H3.309a.5.5 0 0 1-.447-.276l-1.7-3.402a.5.5 0 0 1 .093-.577l.49-.49a.5.5 0 0 1 .577-.094l3.402 1.7A.5.5 0 0 1 6 3.31z\"\u002F>\u003C\u002Fg>",{"left":62,"top":62,"width":118,"height":118,"rotate":62,"vFlip":64,"hFlip":64,"body":131},"\u003Cpath fill=\"currentColor\" fill-rule=\"evenodd\" d=\"M3 10a.75.75 0 0 1 .75-.75h10.638L10.23 5.29a.75.75 0 1 1 1.04-1.08l5.5 5.25a.75.75 0 0 1 0 1.08l-5.5 5.25a.75.75 0 1 1-1.04-1.08l4.158-3.96H3.75A.75.75 0 0 1 3 10\" clip-rule=\"evenodd\"\u002F>",1785143379248]