# MySQL Guide

## Overview

When MySQL is enabled it'll copy the parent server's plugin data, this incudes menu items, interface items, shop items, stock and restock time. Dynamic shop mode is also supported with MySQL. Any changes need to be done on the parent server, any changes made on the parent server will reflect on all connected servers.

## How to setup MySQL

1. Open the `config.yml`.
2. Under the `mysql` key change `enabled` to `true` and input your MySQL database details.
3. If this is the parent server also make sure the key `parent-server` is set to `true`. For all other servers connected to this database, change it to `false`.
4. Restart server, do not reload.
5. If you didn't get any errors on startup you successfully setup MySQL for this plugin.

## How To Update Child Servers To Parent Server

1. When you've made a change to the parent server, like adding or removing items, you'll want to run the command `/shop updatedatabase` to push those updates to the MySQL database. You can also simply restart the server.
2. When this is completed you can now run `/shop reload` on the child servers to apply the update. You can also simply restart the server.
3. You should now see the updates from the parent server on your child server.


---

# 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://lees-plugins.gitbook.io/onestopshop-2/mysql-guide.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.
