Moving the databases to MySQL
When to use it
By default the databases are files in the server folder (Hard drive (SQLite)), and nothing else is needed. The MySQL database package lets the server keep them on a MySQL 8 server instead, on this computer or another one: for example to look at them with your usual database tools or to keep them on a machine that is backed up.
The package is built for Windows only at the moment.
What you need
- A running MySQL 8 server that this computer can reach.
- A MySQL user that may create databases there. LonelyIce creates four databases, named with a prefix you choose:
<prefix>auth,<prefix>characters,<prefix>worldand<prefix>playerbots(with the default prefix,acore_auth,acore_characters, …). - Your game client: the server's game tables are unpacked from it into the world database.
Install the package
- Stop the server.
- Open Plugins › Catalog, find MySQL database and press Install, or run
LonelyIce.exe --pkg install lonelyice.mysql.
A new storage, MySQL server, now appears next to the hard drive in Settings › Storage and in the wizard's Data step. The gear button of the package on the Plugins page opens Settings › Storage.
On a new installation you can start with MySQL right away: install the package with the command above before the first run, then pick MySQL server on the wizard's Data step and fill in the same fields as below.
Choose MySQL in Settings › Storage
- Open Settings; Storage is at the top of the list, under Data.
- Under Data location, pick MySQL server.
- Fill in the connection:
| Field | Default | Meaning |
|---|---|---|
| Server | 127.0.0.1 |
Host name or address of the MySQL server. |
| Port | 3306 |
Its port. |
| User | acore |
The MySQL user. |
| Password | empty | The user's password. |
| Database prefix | acore_ |
Put in front of the database names. |
- Wait a moment: the launcher checks the server by itself shortly after you stop typing. Check runs the check again.
- Press Apply. Undo puts the form back to the storage in use.
Server, User and Database prefix must not be empty ("Fill in the server, the user and the database prefix."). The server must be stopped for Apply ("Stop the server first.").
What the check tells you
| Message | Meaning |
|---|---|
| "Checking the storage…" | The check is running. |
| "No databases there yet: they will be created." | The server answered and the databases do not exist yet. |
| "The databases are in place." | The databases exist and hold the server's tables. |
| "The databases are in place, the game data is unpacked." | They also hold the unpacked game tables. |
| "auth: …" (or another database name) followed by the server's error | The server answered with an error, for example a wrong password or a missing right. |
| "The database server did not answer in time." | No answer within 40 seconds: wrong address or port, the server is not running, or a firewall is in the way. |
The switch
When everything is already in place on the MySQL server, Apply switches at once ("Storage changed."). When something is missing, the wizard opens its Storage page, "Prepare the storage", and lists what it will do, for example:
- Create the databases, when the MySQL server has none yet;
- Bring the databases up to date, when it has them but this LonelyIce brought database updates that were not applied yet;
- Unpack the game data (disk cache).
Only when the databases are new does the page also ask for Your account in the new databases: a login, a password and Rights. Databases that exist keep their accounts. Press Start; the wizard does the work and shows Done when it is finished.
Your characters are not moved. New databases on the MySQL server start empty apart from the account you enter on this page. Moving existing characters from the built-in files is not available yet.
"The databases you leave stay as they are: you can come back to them in Settings." To go back, pick Hard drive
(SQLite) in Settings › Storage and press Apply: your old databases are still in db in the server folder.
What changes
- Backups are off. The launcher's backups work on the built-in database files only; with MySQL, Back up now answers "Backups work only with databases in files." and scheduled backups are skipped. Back up the MySQL databases with MySQL's own tools.
- Database updates of a new LonelyIce are applied on the MySQL server, on the first server start after the update, as with the built-in files (Updating).
- The disk cache is always on. A database server keeps the game tables itself, so they are unpacked into the
world database and the maps and cameras into
datain the server folder ("A database server keeps the game tables itself: they are always unpacked into it."). The server then no longer reads game data from your client. See Game data. - The Maintenance page shows each database as, for example, "database acore_auth on 127.0.0.1:3306".
- The package must stay installed. If it is removed or disabled while MySQL is in use, the server does not start: "The storage “mysql” needs its plugin: install it, or choose another storage in Settings."
- The password is stored in
lonelyice.ininext toLonelyIce.exe, in the[remote]section, as plain text. Use a MySQL user made for LonelyIce.
Configs, logs, backups of earlier days and the game data stay in the server folder as before.
Details
The settings behind this page ([server] location, dataCache and [remote] in lonelyice.ini) are described
in Server game data and lonelyice.ini.