> For the complete documentation index, see [llms.txt](https://edseries-plugins.gitbook.io/p/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://edseries-plugins.gitbook.io/p/edlang/features/storage.md).

# Storage (YAML / MySQL)

EdLang stores each player's chosen language (only when they picked one with `/lang`) and their chat translation switch.

```yaml
storage:
  type: yaml        # or mysql
  mysql:
    host: 'localhost'
    port: 3306
    database: 'minecraft'
    username: 'root'
    password: ''
    table-prefix: 'edlang_'
    use-ssl: false
    properties: 'useUnicode=true&characterEncoding=utf8&serverTimezone=UTC'
```

* **yaml**: `plugins/EdLang/players.yml` (the same format as EdLang 1). Saved in the background, a moment after a change, and never left half written.
* **mysql** (MySQL or MariaDB): one table, `<table-prefix>players` (uuid, language, chat\_translation, updated\_at), created by EdLang. Several servers can share it: a player's choice is loaded while they log in (off the main thread), so `/lang` on one server is used on the next. The same player should not be online on two servers at once.

Every database call runs on EdLang's own IO thread, never on the main thread. A lost connection is re-opened by itself. The password is never written to the console.

If MySQL can't be reached at startup, EdLang logs an error and uses YAML for that run, so players still get their languages; fix the settings and restart.

Changing `storage.type` takes a restart (`/edlang reload` reminds you).

## Moving data

`/edlang migrate yaml mysql` copies every stored player from YAML to MySQL (or the other way round with `migrate mysql yaml`). It runs in the background and says how many players were copied. Then set `storage.type` and restart.
