Choosing An SQL Server¶
Since Evennia uses Django, most of our notes are based off of what we know from the community and their documentation. While the information below may be useful, you can always find the most up-to-date and “correct” information at Django’s Notes about supported Databases page.
This is the default database used out of the box. SQLite stores the
database in a single file (
mygame/server/evennia.db3). This means
it’s very easy to reset this database - just delete (or move) that
evennia.db3 file and run
evennia migrate again! No server
process is needed and the administrative overhead and resource
consumption is tiny. It is also very fast since it’s run in-memory. For
the vast majority of Evennia installs it will probably be all that’s
SQLite will generally be much faster than MySQL/PostGreSQL but it might not scale as well for huge databases. Its main drawback is otherwise that it does not work very well with multiple concurrent threads or processes. This has to do with file-locking clashes of the database file. So for a production server making heavy use of process- or threadpools (or when using a third-party webserver like Apache), a more full-featured database may be the better choice.
This is Django’s recommended database engine, While not as fast as SQLite for normal usage, it will scale better than SQLite, especially if your game has an very large database and/or extensive web presence through a separate server process.
Apart from the postgres server and -client for your OS, one must also
pip install psycopg2 to allow Postgresql to interface with Python.
Here is a tutorial for configuring postgreSQL with Django (and thus
Evennia) on Linux.
MySQL behaves similarly to PosgreSQL. Apart from the MySQL server and
-client, one must also do
pip install mysql-python to allow MySQL to
communicate with Python. Here is a tutorial for setting up MySQL with
Django (and thus Evennia) on Linux.
There is an open-source alternative to MySQL named MariaDB. While this is supposed to work the same way as MySQL, There is currently (May 2017) an apparent issue with it. Any help with verifying/resolving this is welcome!
Older versions of MySQL had some peculiarities, so check out Django’s Notes about supported Databases to make sure you use the correct version.
Inspecting database data¶
If you know SQL you can easily get command line access to your database like this:
This will drop you into the command line client for your respective database. If you don’t have it you may need to install it separately; see the django dbshell documentation for more information.
NOTE: Under Windows, in order to access SQLite dbshell you need to download the SQLite command-line shell program. It’s a single executable file (sqlite3.exe) that you should place in the root of either your MUD folder or Evennia’s (it’s the same, in both cases Django will find it).