Настройка базы данных: различия между версиями

Материал из SS220 Paradise Wiki (SS13)
Перейти к навигации Перейти к поиску
(частичный перевод)
м (частичный перевод)
Строка 7: Строка 7:
** Нажмите на кнопку Создать в левом нижнем углу, заполните данные для входа на сервер.
** Нажмите на кнопку Создать в левом нижнем углу, заполните данные для входа на сервер.
** Нажмите Сохранить, затем Открыть для входа под заданным пользователем и паролем, выставленным при установке.
** Нажмите Сохранить, затем Открыть для входа под заданным пользователем и паролем, выставленным при установке.
* Выберите базу данных которую вы только что создали и затемнажмите Файл -> Load SQL File, and open the paradise_schema.sql file found in the \SQL directory of the game. You can also find it [https://github.com/ss220-space/Paradise/blob/master/SQL/paradise_schema.sql here], but it may be newer than the version you are using.
* Выберите базу данных которую вы только что создали и затем нажмите Файл -> Загрузить SQL файл, и откройте paradise_schema.sql файл, который находится в папке \SQL билда. Так же вы можете найти его [https://github.com/ss220-space/Paradise/blob/master/SQL/paradise_schema.sql тут], но он может быть новее чем версия которую вы используете.
* Press the blue play icon in the topic bar of icon hieroglyphs and pray. If the schema imported correctly you should have no errors in the message box on the bottom.   
* Press the blue play icon in the topic bar of icon hieroglyphs and pray. Если схема импортирована корректно, внизу в окошке не появится никаких ошибок.   
** Refresh the panel on the left by right clicking it and ensure there's a new database called "paradise_gamedb" created.
** Обновите панель слева by right clicking it and ensure there's a new database called "paradise_gamedb" created.
* Create a new user account for the server by going to Tools -> User manager.
* Create a new user account for the server by going to Tools -> User manager.
** 'From host' should be 127.0.0.1, not localhost if hosted locally, otherwise use the IP of the game server.
** 'From host' should be 127.0.0.1, not localhost if hosted locally, otherwise use the IP of the game server.
Строка 15: Строка 15:
** You can click the arrow on the password field to get a randomly generated password of certain lengths, copy the password before saving as it will be cleared the moment you hit save.
** You can click the arrow on the password field to get a randomly generated password of certain lengths, copy the password before saving as it will be cleared the moment you hit save.
* Open the file: [https://github.com/ss220-space/Paradise/blob/master/config/example/config.toml \config\config.toml] in notepad, notepad++, VSCode, or your favourite text editor, and scroll down to the <code>[database_configuration]</code> section. You should've copied the file over from the \example folder beforehand.  
* Open the file: [https://github.com/ss220-space/Paradise/blob/master/config/example/config.toml \config\config.toml] in notepad, notepad++, VSCode, or your favourite text editor, and scroll down to the <code>[database_configuration]</code> section. You should've copied the file over from the \example folder beforehand.  
* Make sure that these settings are changed:
* Убедитесь что эти настройки изменились:
** <code>sql_enabled</code> is set to <code>true</code>.
** <code>sql_enabled</code> выставлена в <code>true</code>.
** <code>sql_address</code> is set to <code>"127.0.0.1"</code>. (Replace with the database server's IP if not hosted locally)
** <code>sql_address</code> выставлена в <code>"127.0.0.1"</code>. (Измените на IP сервера базы данных если он установлен на другой машине)
** <code>sql_port</code> is set to whatever port was selected during the MariaDB install, usually <code>3306</code>.
** <code>sql_port</code> выставлен тот порт, который вы задали при установке MariaDB, обычно это <code>3306</code>.
** <code>sql_database</code> is set to the name of your database, usually <code>"paradise_gamedb"</code>.
** <code>sql_database</code> выставлено название вашей базы данных, обычно это <code>"paradise_gamedb"</code>.
** <code>sql_username</code> is set to the 'User name' of the user you created above.
** <code>sql_username</code> выставлено имя пользователя которого вы создали выше.
** <code>sql_password</code> is set to the randomly generated 'Password' of the user you created above.
** <code>sql_password</code> is set to the randomly generated 'Password' of the user you created above.
* The database is now set up for death logging, population logging, polls, library, privacy poll, connection logging and player logging. There are two more features which you should consider. And it's best to do so now, since adopting them later can be a pain.
* The database is now set up for death logging, population logging, polls, library, privacy poll, connection logging and player logging. There are two more features which you should consider. And it's best to do so now, since adopting them later can be a pain.

Версия от 00:15, 9 августа 2022

MakeshiftGarrote.PNGЭтой странице требуется переводMakeshiftGarrote.PNG
Эта статья содержит непереведенную информацию.


Первоначальная настройка и установка

  • Скачайте и установите MariaDB.
    • (настроек по умолчанию достаточно, вам нужно включить tcp и выставить пароль root. Если он предложит, do not set it up to use windows authentication)
      • Если вы выбрали флажек Install as a Windows Service (Установить как службу Windows, по умолчанию он включен), сервер базы данных будет запускатся при старте системы, не нужно будет каждый раз запускать его вручную.
  • Откройте HeidiSQL (идет вместе с Mariadb) и соединитесь с базой данных.
    • Нажмите на кнопку Создать в левом нижнем углу, заполните данные для входа на сервер.
    • Нажмите Сохранить, затем Открыть для входа под заданным пользователем и паролем, выставленным при установке.
  • Выберите базу данных которую вы только что создали и затем нажмите Файл -> Загрузить SQL файл, и откройте paradise_schema.sql файл, который находится в папке \SQL билда. Так же вы можете найти его тут, но он может быть новее чем версия которую вы используете.
  • Press the blue play icon in the topic bar of icon hieroglyphs and pray. Если схема импортирована корректно, внизу в окошке не появится никаких ошибок.
    • Обновите панель слева by right clicking it and ensure there's a new database called "paradise_gamedb" created.
  • Create a new user account for the server by going to Tools -> User manager.
    • 'From host' should be 127.0.0.1, not localhost if hosted locally, otherwise use the IP of the game server.
    • For permissions, do not give it any global permissions, instead click 'Add object', and then select the database you created for the server, hit ok, then give it SELECT, DELETE, INSERT, and UPDATE permissions on that database.
    • You can click the arrow on the password field to get a randomly generated password of certain lengths, copy the password before saving as it will be cleared the moment you hit save.
  • Open the file: \config\config.toml in notepad, notepad++, VSCode, or your favourite text editor, and scroll down to the [database_configuration] section. You should've copied the file over from the \example folder beforehand.
  • Убедитесь что эти настройки изменились:
    • sql_enabled выставлена в true.
    • sql_address выставлена в "127.0.0.1". (Измените на IP сервера базы данных если он установлен на другой машине)
    • sql_port выставлен тот порт, который вы задали при установке MariaDB, обычно это 3306.
    • sql_database выставлено название вашей базы данных, обычно это "paradise_gamedb".
    • sql_username выставлено имя пользователя которого вы создали выше.
    • sql_password is set to the randomly generated 'Password' of the user you created above.
  • The database is now set up for death logging, population logging, polls, library, privacy poll, connection logging and player logging. There are two more features which you should consider. And it's best to do so now, since adopting them later can be a pain.

Database based administration

Offers a changelog for changes done to admins, which increases accountability (adding/removing admins, adding/removing permissions, changing ranks); allows admins with +PERMISSIONS to edit other admins' permissions ingame, meaning they don't need remote desktop access to edit admins; Allows for custom ranks, with permissions not being tied to ranks, offering a better ability for the removal or addition of permissions to certain admins, if they need to be punished, or need extra permissions. Enabling this can be done any time, it's just a bit tedious the first time you do it, if you don't have direct access to the database.

To enable database based administration:

  • Open \config\config.toml and scroll to the [admin_configuration] section.
  • Set use_database_admins to true.
  • Add a database entry for the first administrator (likely yourself).
  • Done! Note that anyone set in the admin_assignments list will no longer be counted.
  • If your database ever dies, your server will revert to the old admin system, so it is a good idea to have admin_assignments and admin_ranks set up with some admins too, just so that the loss of the database doesn't completely destroy everything.
Как внести свой вклад?
Общее Руководство по разработке
Сервер Настройка базы данных, Запуск локального сервера
Код Структура кода SS13, SS13 для опытных программистов, Форматирование текста, Как делать перевод игры
Маппинг Руководство по маппингу
Спрайтинг Руководство по спрайтингу
Вики Руководство по редактированию вики