# Data & MySQL

## Storage Types

* Local files are stored in the `MysteryBoxes/data/` folder.
* MySQL data is stored in tables that start with the `MB` prefix.

## How to enable MySQL

1. Open the `config.yml` file.
2. Set `enabled` to `true` under `mysql-settings`.
3. Fill in the credentials to match your database's settings.

## How to set-up File Sync

File Sync allows you to keep some config files in the database. This is very useful when you have the plugin on more than one server. It makes managing the files easier because you only have to deal with one copy of each file.

After you change a file in the database, you can use the command `/mb release` on any server. This will send the changes to all the plugins that are linked to that database.

1. Enable the File Sync
2. Open phpMyAdmin
3. Open the tables that start with the "MB\_FILE\_" prefix.
4. Execute a query to add a file to the table.
   * Example: `INSERT INTO MB_FILE_BOXES (ID, FILE) VALUES ('testID', 'configFile');`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://xerickerspigot.gitbook.io/mysteryboxes/setting-up/data-and-mysql.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
