mirror of
https://github.com/evennia/evennia.git
synced 2026-03-18 22:06:30 +01:00
358 lines
28 KiB
HTML
358 lines
28 KiB
HTML
|
|
|
|||
|
|
<!DOCTYPE html>
|
|||
|
|
|
|||
|
|
<html>
|
|||
|
|
<head>
|
|||
|
|
<meta charset="utf-8" />
|
|||
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
|
|||
|
|
|
|||
|
|
<title>Choosing An SQL Server — Evennia 0.9.5 documentation</title>
|
|||
|
|
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
|
|||
|
|
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
|||
|
|
<script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
|
|||
|
|
<script src="_static/jquery.js"></script>
|
|||
|
|
<script src="_static/underscore.js"></script>
|
|||
|
|
<script src="_static/doctools.js"></script>
|
|||
|
|
<script src="_static/language_data.js"></script>
|
|||
|
|
<script async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
|
|||
|
|
<script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"processClass": "tex2jax_process|mathjax_process|math|output_area"}})</script>
|
|||
|
|
<link rel="shortcut icon" href="_static/favicon.ico"/>
|
|||
|
|
<link rel="index" title="Index" href="genindex.html" />
|
|||
|
|
<link rel="search" title="Search" href="search.html" />
|
|||
|
|
</head><body>
|
|||
|
|
<div class="related" role="navigation" aria-label="related navigation">
|
|||
|
|
<h3>Navigation</h3>
|
|||
|
|
<ul>
|
|||
|
|
<li class="right" style="margin-right: 10px">
|
|||
|
|
<a href="genindex.html" title="General Index"
|
|||
|
|
accesskey="I">index</a></li>
|
|||
|
|
<li class="right" >
|
|||
|
|
<a href="py-modindex.html" title="Python Module Index"
|
|||
|
|
>modules</a> |</li>
|
|||
|
|
<li class="nav-item nav-item-0"><a href="index.html">Evennia 0.9.5</a> »</li>
|
|||
|
|
<li class="nav-item nav-item-this"><a href="">Choosing An SQL Server</a></li>
|
|||
|
|
</ul>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="document">
|
|||
|
|
<div class="documentwrapper">
|
|||
|
|
<div class="bodywrapper">
|
|||
|
|
<div class="body" role="main">
|
|||
|
|
|
|||
|
|
<section class="tex2jax_ignore mathjax_ignore" id="choosing-an-sql-server">
|
|||
|
|
<h1>Choosing An SQL Server<a class="headerlink" href="#choosing-an-sql-server" title="Permalink to this headline">¶</a></h1>
|
|||
|
|
<p>This page gives an overview of the supported SQL databases as well as instructions on install:</p>
|
|||
|
|
<ul class="simple">
|
|||
|
|
<li><p>SQLite3 (default)</p></li>
|
|||
|
|
<li><p>PostgreSQL</p></li>
|
|||
|
|
<li><p>MySQL / MariaDB</p></li>
|
|||
|
|
</ul>
|
|||
|
|
<p>Since Evennia uses <a class="reference external" href="http://djangoproject.com">Django</a>, 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 <a class="reference external" href="http://docs.djangoproject.com/en/dev/ref/databases/#ref-databases">Notes about supported
|
|||
|
|
Databases</a> page.</p>
|
|||
|
|
<section id="sqlite3">
|
|||
|
|
<h2>SQLite3<a class="headerlink" href="#sqlite3" title="Permalink to this headline">¶</a></h2>
|
|||
|
|
<p><a class="reference external" href="https://sqlite.org/">SQLite3</a> is a light weight single-file database. It is our default database
|
|||
|
|
and Evennia will set this up for you automatically if you give no other options. SQLite stores the
|
|||
|
|
database in a single file (<code class="docutils literal notranslate"><span class="pre">mygame/server/evennia.db3</span></code>). This means it’s very easy to reset this
|
|||
|
|
database - just delete (or move) that <code class="docutils literal notranslate"><span class="pre">evennia.db3</span></code> file and run <code class="docutils literal notranslate"><span class="pre">evennia</span> <span class="pre">migrate</span></code> 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 ever needed.</p>
|
|||
|
|
<p>SQLite will generally be much faster than MySQL/PostgreSQL but its performance comes with two
|
|||
|
|
drawbacks:</p>
|
|||
|
|
<ul class="simple">
|
|||
|
|
<li><p>SQLite <a class="reference external" href="https://www.sqlite.org/faq.html#q9">ignores length constraints by design</a>; it is possible
|
|||
|
|
to store very large strings and numbers in fields that technically should not accept them. This is
|
|||
|
|
not something you will notice; your game will read and write them and function normally, but this
|
|||
|
|
<em>can</em> create some data migration problems requiring careful thought if you do need to change
|
|||
|
|
databases later.</p></li>
|
|||
|
|
<li><p>SQLite can scale well to storage of millions of objects, but if you end up with a thundering herd
|
|||
|
|
of users trying to access your MUD and web site at the same time, or you find yourself writing long-
|
|||
|
|
running functions to update large numbers of objects on a live game, either will yield errors and
|
|||
|
|
interference. SQLite does not work reliably with multiple concurrent threads or processes accessing
|
|||
|
|
its records. This has to do with file-locking clashes of the database file. So for a production
|
|||
|
|
server making heavy use of process- or thread pools (or when using a third-party webserver like
|
|||
|
|
Apache), a proper database is a more appropriate choice.</p></li>
|
|||
|
|
</ul>
|
|||
|
|
<section id="install-of-sqlite3">
|
|||
|
|
<h3>Install of SQlite3<a class="headerlink" href="#install-of-sqlite3" title="Permalink to this headline">¶</a></h3>
|
|||
|
|
<p>This is installed and configured as part of Evennia. The database file is created as
|
|||
|
|
<code class="docutils literal notranslate"><span class="pre">mygame/server/evennia.db3</span></code> when you run</p>
|
|||
|
|
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>evennia migrate
|
|||
|
|
</pre></div>
|
|||
|
|
</div>
|
|||
|
|
<p>without changing any database options. An optional requirement is the <code class="docutils literal notranslate"><span class="pre">sqlite3</span></code> client program -
|
|||
|
|
this is required if you want to inspect the database data manually. A shortcut for using it with the
|
|||
|
|
evennia database is <code class="docutils literal notranslate"><span class="pre">evennia</span> <span class="pre">dbshell</span></code>. Linux users should look for the <code class="docutils literal notranslate"><span class="pre">sqlite3</span></code> package for their
|
|||
|
|
distro while Mac/Windows should get the <a class="reference external" href="https://sqlite.org/download.html">sqlite-tools package from this
|
|||
|
|
page</a>.</p>
|
|||
|
|
<p>To inspect the default Evennia database (once it’s been created), go to your game dir and do</p>
|
|||
|
|
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span> sqlite3 server/evennia.db3
|
|||
|
|
<span class="c1"># or</span>
|
|||
|
|
evennia dbshell
|
|||
|
|
</pre></div>
|
|||
|
|
</div>
|
|||
|
|
<p>This will bring you into the sqlite command line. Use <code class="docutils literal notranslate"><span class="pre">.help</span></code> for instructions and <code class="docutils literal notranslate"><span class="pre">.quit</span></code> to exit.
|
|||
|
|
See <a class="reference external" href="https://gist.github.com/vincent178/10889334">here</a> for a cheat-sheet of commands.</p>
|
|||
|
|
</section>
|
|||
|
|
</section>
|
|||
|
|
<section id="postgresql">
|
|||
|
|
<h2>PostgreSQL<a class="headerlink" href="#postgresql" title="Permalink to this headline">¶</a></h2>
|
|||
|
|
<p><a class="reference external" href="https://www.postgresql.org/">PostgreSQL</a> is an open-source database engine, recommended by Django.
|
|||
|
|
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.</p>
|
|||
|
|
<section id="install-and-initial-setup-of-postgresql">
|
|||
|
|
<h3>Install and initial setup of PostgreSQL<a class="headerlink" href="#install-and-initial-setup-of-postgresql" title="Permalink to this headline">¶</a></h3>
|
|||
|
|
<p>First, install the posgresql server. Version <code class="docutils literal notranslate"><span class="pre">9.6</span></code> is tested with Evennia. Packages are readily
|
|||
|
|
available for all distributions. You need to also get the <code class="docutils literal notranslate"><span class="pre">psql</span></code> client (this is called <code class="docutils literal notranslate"><span class="pre">postgresql-</span> <span class="pre">client</span></code> on debian-derived systems). Windows/Mac users can <a class="reference external" href="https://www.postgresql.org/download/">find what they need on the postgresql
|
|||
|
|
download page</a>. You should be setting up a password for your
|
|||
|
|
database-superuser (always called <code class="docutils literal notranslate"><span class="pre">postgres</span></code>) when you install.</p>
|
|||
|
|
<p>For interaction with Evennia you need to also install <code class="docutils literal notranslate"><span class="pre">psycopg2</span></code> to your Evennia install (<code class="docutils literal notranslate"><span class="pre">pip</span> <span class="pre">install</span> <span class="pre">psycopg2-binary</span></code> in your virtualenv). This acts as the python bridge to the database server.</p>
|
|||
|
|
<p>Next, start the postgres client:</p>
|
|||
|
|
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span> psql -U postgres --password
|
|||
|
|
</pre></div>
|
|||
|
|
</div>
|
|||
|
|
<blockquote>
|
|||
|
|
<div><p>:warning: <strong>Warning:</strong> With the <code class="docutils literal notranslate"><span class="pre">--password</span></code> argument, Postgres should prompt you for a password.
|
|||
|
|
If it won’t, replace that with <code class="docutils literal notranslate"><span class="pre">-p</span> <span class="pre">yourpassword</span></code> instead. Do not use the <code class="docutils literal notranslate"><span class="pre">-p</span></code> argument unless you
|
|||
|
|
have to since the resulting command, and your password, will be logged in the shell history.</p>
|
|||
|
|
</div></blockquote>
|
|||
|
|
<p>This will open a console to the postgres service using the psql client.</p>
|
|||
|
|
<p>On the psql command line:</p>
|
|||
|
|
<div class="highlight-sql notranslate"><div class="highlight"><pre><span></span><span class="k">CREATE</span><span class="w"> </span><span class="k">USER</span><span class="w"> </span><span class="n">evennia</span><span class="w"> </span><span class="k">WITH</span><span class="w"> </span><span class="n">PASSWORD</span><span class="w"> </span><span class="s1">'somepassword'</span><span class="p">;</span><span class="w"></span>
|
|||
|
|
<span class="k">CREATE</span><span class="w"> </span><span class="k">DATABASE</span><span class="w"> </span><span class="n">evennia</span><span class="p">;</span><span class="w"></span>
|
|||
|
|
|
|||
|
|
<span class="c1">-- Postgres-specific optimizations</span>
|
|||
|
|
<span class="c1">-- https://docs.djangoproject.com/en/dev/ref/databases/#optimizing-postgresql-s-configuration</span>
|
|||
|
|
<span class="k">ALTER</span><span class="w"> </span><span class="k">ROLE</span><span class="w"> </span><span class="n">evennia</span><span class="w"> </span><span class="k">SET</span><span class="w"> </span><span class="n">client_encoding</span><span class="w"> </span><span class="k">TO</span><span class="w"> </span><span class="s1">'utf8'</span><span class="p">;</span><span class="w"></span>
|
|||
|
|
<span class="k">ALTER</span><span class="w"> </span><span class="k">ROLE</span><span class="w"> </span><span class="n">evennia</span><span class="w"> </span><span class="k">SET</span><span class="w"> </span><span class="n">default_transaction_isolation</span><span class="w"> </span><span class="k">TO</span><span class="w"> </span><span class="s1">'read committed'</span><span class="p">;</span><span class="w"></span>
|
|||
|
|
<span class="k">ALTER</span><span class="w"> </span><span class="k">ROLE</span><span class="w"> </span><span class="n">evennia</span><span class="w"> </span><span class="k">SET</span><span class="w"> </span><span class="n">timezone</span><span class="w"> </span><span class="k">TO</span><span class="w"> </span><span class="s1">'UTC'</span><span class="p">;</span><span class="w"></span>
|
|||
|
|
|
|||
|
|
<span class="k">GRANT</span><span class="w"> </span><span class="k">ALL</span><span class="w"> </span><span class="k">PRIVILEGES</span><span class="w"> </span><span class="k">ON</span><span class="w"> </span><span class="k">DATABASE</span><span class="w"> </span><span class="n">evennia</span><span class="w"> </span><span class="k">TO</span><span class="w"> </span><span class="n">evennia</span><span class="p">;</span><span class="w"></span>
|
|||
|
|
<span class="c1">-- Other useful commands:</span>
|
|||
|
|
<span class="c1">-- \l (list all databases and permissions)</span>
|
|||
|
|
<span class="c1">-- \q (exit)</span>
|
|||
|
|
</pre></div>
|
|||
|
|
</div>
|
|||
|
|
<p><a class="reference external" href="https://gist.github.com/Kartones/dd3ff5ec5ea238d4c546">Here</a> is a cheat-sheet for psql commands.</p>
|
|||
|
|
<p>We create a database user ‘evennia’ and a new database named <code class="docutils literal notranslate"><span class="pre">evennia</span></code> (you can call them whatever
|
|||
|
|
you want though). We then grant the ‘evennia’ user full privileges to the new database so it can
|
|||
|
|
read/write etc to it.
|
|||
|
|
If you in the future wanted to completely wipe the database, an easy way to do is to log in as the
|
|||
|
|
<code class="docutils literal notranslate"><span class="pre">postgres</span></code> superuser again, then do <code class="docutils literal notranslate"><span class="pre">DROP</span> <span class="pre">DATABASE</span> <span class="pre">evennia;</span></code>, then <code class="docutils literal notranslate"><span class="pre">CREATE</span></code> and <code class="docutils literal notranslate"><span class="pre">GRANT</span></code> steps above
|
|||
|
|
again to recreate the database and grant privileges.</p>
|
|||
|
|
</section>
|
|||
|
|
<section id="evennia-postgresql-configuration">
|
|||
|
|
<h3>Evennia PostgreSQL configuration<a class="headerlink" href="#evennia-postgresql-configuration" title="Permalink to this headline">¶</a></h3>
|
|||
|
|
<p>Edit `mygame/server/conf/secret_settings.py and add the following section:</p>
|
|||
|
|
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="c1">#</span>
|
|||
|
|
<span class="c1"># PostgreSQL Database Configuration</span>
|
|||
|
|
<span class="c1">#</span>
|
|||
|
|
<span class="n">DATABASES</span> <span class="o">=</span> <span class="p">{</span>
|
|||
|
|
<span class="s1">'default'</span><span class="p">:</span> <span class="p">{</span>
|
|||
|
|
<span class="s1">'ENGINE'</span><span class="p">:</span> <span class="s1">'django.db.backends.postgresql_psycopg2'</span><span class="p">,</span>
|
|||
|
|
<span class="s1">'NAME'</span><span class="p">:</span> <span class="s1">'evennia'</span><span class="p">,</span>
|
|||
|
|
<span class="s1">'USER'</span><span class="p">:</span> <span class="s1">'evennia'</span><span class="p">,</span>
|
|||
|
|
<span class="s1">'PASSWORD'</span><span class="p">:</span> <span class="s1">'somepassword'</span><span class="p">,</span>
|
|||
|
|
<span class="s1">'HOST'</span><span class="p">:</span> <span class="s1">'localhost'</span><span class="p">,</span>
|
|||
|
|
<span class="s1">'PORT'</span><span class="p">:</span> <span class="s1">''</span> <span class="c1"># use default</span>
|
|||
|
|
<span class="p">}}</span>
|
|||
|
|
</pre></div>
|
|||
|
|
</div>
|
|||
|
|
<p>If you used some other name for the database and user, enter those instead. Run</p>
|
|||
|
|
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>evennia migrate
|
|||
|
|
</pre></div>
|
|||
|
|
</div>
|
|||
|
|
<p>to populate your database. Should you ever want to inspect the database directly you can from now on
|
|||
|
|
also use</p>
|
|||
|
|
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>evennia dbshell
|
|||
|
|
</pre></div>
|
|||
|
|
</div>
|
|||
|
|
<p>as a shortcut to get into the postgres command line for the right database and user.</p>
|
|||
|
|
<p>With the database setup you should now be able to start start Evennia normally with your new
|
|||
|
|
database.</p>
|
|||
|
|
</section>
|
|||
|
|
</section>
|
|||
|
|
<section id="mysql-mariadb">
|
|||
|
|
<h2>MySQL / MariaDB<a class="headerlink" href="#mysql-mariadb" title="Permalink to this headline">¶</a></h2>
|
|||
|
|
<p><a class="reference external" href="https://www.mysql.com/">MySQL</a> is a commonly used proprietary database system, on par with
|
|||
|
|
PostgreSQL. There is an open-source alternative called <a class="reference external" href="https://mariadb.org/">MariaDB</a> that mimics
|
|||
|
|
all functionality and command syntax of the former. So this section covers both.</p>
|
|||
|
|
<section id="installing-and-initial-setup-of-mysql-mariadb">
|
|||
|
|
<h3>Installing and initial setup of MySQL/MariaDB<a class="headerlink" href="#installing-and-initial-setup-of-mysql-mariadb" title="Permalink to this headline">¶</a></h3>
|
|||
|
|
<p>First, install and setup MariaDB or MySQL for your specific server. Linux users should look for the
|
|||
|
|
<code class="docutils literal notranslate"><span class="pre">mysql-server</span></code> or <code class="docutils literal notranslate"><span class="pre">mariadb-server</span></code> packages for their respective distributions. Windows/Mac users
|
|||
|
|
will find what they need from the <a class="reference external" href="https://www.mysql.com/downloads/">MySQL downloads</a> or <a class="reference external" href="https://mariadb.org/download/">MariaDB
|
|||
|
|
downloads</a> pages. You also need the respective database clients
|
|||
|
|
(<code class="docutils literal notranslate"><span class="pre">mysql</span></code>, <code class="docutils literal notranslate"><span class="pre">mariadb-client</span></code>), so you can setup the database itself. When you install the server you
|
|||
|
|
should usually be asked to set up the database root user and password.</p>
|
|||
|
|
<p>You will finally also need a Python interface to allow Evennia to talk to the database. Django
|
|||
|
|
recommends the <code class="docutils literal notranslate"><span class="pre">mysqlclient</span></code> one. Install this into the evennia virtualenv with <code class="docutils literal notranslate"><span class="pre">pip</span> <span class="pre">install</span> <span class="pre">mysqlclient</span></code>.</p>
|
|||
|
|
<p>Start the database client (this is named the same for both mysql and mariadb):</p>
|
|||
|
|
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>mysql -u root -p
|
|||
|
|
</pre></div>
|
|||
|
|
</div>
|
|||
|
|
<p>You should get to enter your database root password (set this up when you installed the database
|
|||
|
|
server).</p>
|
|||
|
|
<p>Inside the database client interface:</p>
|
|||
|
|
<div class="highlight-sql notranslate"><div class="highlight"><pre><span></span><span class="k">CREATE</span><span class="w"> </span><span class="k">USER</span><span class="w"> </span><span class="s1">'evennia'</span><span class="o">@</span><span class="s1">'localhost'</span><span class="w"> </span><span class="n">IDENTIFIED</span><span class="w"> </span><span class="k">BY</span><span class="w"> </span><span class="s1">'somepassword'</span><span class="p">;</span><span class="w"></span>
|
|||
|
|
<span class="k">CREATE</span><span class="w"> </span><span class="k">DATABASE</span><span class="w"> </span><span class="n">evennia</span><span class="p">;</span><span class="w"></span>
|
|||
|
|
<span class="k">ALTER</span><span class="w"> </span><span class="k">DATABASE</span><span class="w"> </span><span class="o">`</span><span class="n">evennia</span><span class="o">`</span><span class="w"> </span><span class="nb">CHARACTER</span><span class="w"> </span><span class="k">SET</span><span class="w"> </span><span class="n">utf8</span><span class="p">;</span><span class="w"> </span><span class="c1">-- note that it's `evennia` with back-ticks, not</span>
|
|||
|
|
<span class="n">quotes</span><span class="o">!</span><span class="w"></span>
|
|||
|
|
<span class="k">GRANT</span><span class="w"> </span><span class="k">ALL</span><span class="w"> </span><span class="k">PRIVILEGES</span><span class="w"> </span><span class="k">ON</span><span class="w"> </span><span class="n">evennia</span><span class="p">.</span><span class="o">*</span><span class="w"> </span><span class="k">TO</span><span class="w"> </span><span class="s1">'evennia'</span><span class="o">@</span><span class="s1">'localhost'</span><span class="p">;</span><span class="w"></span>
|
|||
|
|
<span class="n">FLUSH</span><span class="w"> </span><span class="k">PRIVILEGES</span><span class="p">;</span><span class="w"></span>
|
|||
|
|
<span class="c1">-- use 'exit' to quit client</span>
|
|||
|
|
</pre></div>
|
|||
|
|
</div>
|
|||
|
|
<p><a class="reference external" href="https://gist.github.com/hofmannsven/9164408">Here</a> is a mysql command cheat sheet.</p>
|
|||
|
|
<p>Above we created a new local user and database (we called both ‘evennia’ here, you can name them
|
|||
|
|
what you prefer). We set the character set to <code class="docutils literal notranslate"><span class="pre">utf8</span></code> to avoid an issue with prefix character length
|
|||
|
|
that can pop up on some installs otherwise. Next we grant the ‘evennia’ user all privileges on the
|
|||
|
|
<code class="docutils literal notranslate"><span class="pre">evennia</span></code> database and make sure the privileges are applied. Exiting the client brings us back to
|
|||
|
|
the normal terminal/console.</p>
|
|||
|
|
<blockquote>
|
|||
|
|
<div><p>Note: If you are not using MySQL for anything else you might consider granting the ‘evennia’ user
|
|||
|
|
full privileges with <code class="docutils literal notranslate"><span class="pre">GRANT</span> <span class="pre">ALL</span> <span class="pre">PRIVILEGES</span> <span class="pre">ON</span> <span class="pre">*.*</span> <span class="pre">TO</span> <span class="pre">'evennia'@'localhost';</span></code>. If you do, it means
|
|||
|
|
you can use <code class="docutils literal notranslate"><span class="pre">evennia</span> <span class="pre">dbshell</span></code> later to connect to mysql, drop your database and re-create it as a
|
|||
|
|
way of easy reset. Without this extra privilege you will be able to drop the database but not re-
|
|||
|
|
create it without first switching to the database-root user.</p>
|
|||
|
|
</div></blockquote>
|
|||
|
|
</section>
|
|||
|
|
</section>
|
|||
|
|
<section id="add-mysql-configuration-to-evennia">
|
|||
|
|
<h2>Add MySQL configuration to Evennia<a class="headerlink" href="#add-mysql-configuration-to-evennia" title="Permalink to this headline">¶</a></h2>
|
|||
|
|
<p>To tell Evennia to use your new database you need to edit <code class="docutils literal notranslate"><span class="pre">mygame/server/conf/settings.py</span></code> (or
|
|||
|
|
<code class="docutils literal notranslate"><span class="pre">secret_settings.py</span></code> if you don’t want your db info passed around on git repositories).</p>
|
|||
|
|
<blockquote>
|
|||
|
|
<div><p>Note: The Django documentation suggests using an external <code class="docutils literal notranslate"><span class="pre">db.cnf</span></code> or other external conf-
|
|||
|
|
formatted file. Evennia users have however found that this leads to problems (see e.g. <a class="reference external" href="https://git.io/vQdiN">issue
|
|||
|
|
#1184</a>). To avoid trouble we recommend you simply put the configuration in
|
|||
|
|
your settings as below.</p>
|
|||
|
|
</div></blockquote>
|
|||
|
|
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span> <span class="c1">#</span>
|
|||
|
|
<span class="c1"># MySQL Database Configuration</span>
|
|||
|
|
<span class="c1">#</span>
|
|||
|
|
<span class="n">DATABASES</span> <span class="o">=</span> <span class="p">{</span>
|
|||
|
|
<span class="s1">'default'</span><span class="p">:</span> <span class="p">{</span>
|
|||
|
|
<span class="s1">'ENGINE'</span><span class="p">:</span> <span class="s1">'django.db.backends.mysql'</span><span class="p">,</span>
|
|||
|
|
<span class="s1">'NAME'</span><span class="p">:</span> <span class="s1">'evennia'</span><span class="p">,</span>
|
|||
|
|
<span class="s1">'USER'</span><span class="p">:</span> <span class="s1">'evennia'</span><span class="p">,</span>
|
|||
|
|
<span class="s1">'PASSWORD'</span><span class="p">:</span> <span class="s1">'somepassword'</span><span class="p">,</span>
|
|||
|
|
<span class="s1">'HOST'</span><span class="p">:</span> <span class="s1">'localhost'</span><span class="p">,</span> <span class="c1"># or an IP Address that your DB is hosted on</span>
|
|||
|
|
<span class="s1">'PORT'</span><span class="p">:</span> <span class="s1">''</span><span class="p">,</span> <span class="c1"># use default port</span>
|
|||
|
|
<span class="p">}</span>
|
|||
|
|
<span class="p">}</span>
|
|||
|
|
</pre></div>
|
|||
|
|
</div>
|
|||
|
|
<p>Change this to fit your database setup. Next, run:</p>
|
|||
|
|
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>evennia migrate
|
|||
|
|
</pre></div>
|
|||
|
|
</div>
|
|||
|
|
<p>to populate your database. Should you ever want to inspect the database directly you can from now on
|
|||
|
|
also use</p>
|
|||
|
|
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>evennia dbshell
|
|||
|
|
</pre></div>
|
|||
|
|
</div>
|
|||
|
|
<p>as a shortcut to get into the postgres command line for the right database and user.</p>
|
|||
|
|
<p>With the database setup you should now be able to start start Evennia normally with your new
|
|||
|
|
database.</p>
|
|||
|
|
</section>
|
|||
|
|
<section id="others">
|
|||
|
|
<h2>Others<a class="headerlink" href="#others" title="Permalink to this headline">¶</a></h2>
|
|||
|
|
<p>No testing has been performed with Oracle, but it is also supported through Django. There are
|
|||
|
|
community maintained drivers for <a class="reference external" href="http://code.google.com/p/django-mssql/">MS SQL</a> and possibly a few
|
|||
|
|
others. If you try other databases out, consider expanding this page with instructions.</p>
|
|||
|
|
</section>
|
|||
|
|
</section>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<div class="clearer"></div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
|
|||
|
|
<div class="sphinxsidebarwrapper">
|
|||
|
|
<p class="logo"><a href="index.html">
|
|||
|
|
<img class="logo" src="_static/evennia_logo.png" alt="Logo"/>
|
|||
|
|
</a></p>
|
|||
|
|
<div id="searchbox" style="display: none" role="search">
|
|||
|
|
<h3 id="searchlabel">Quick search</h3>
|
|||
|
|
<div class="searchformwrapper">
|
|||
|
|
<form class="search" action="search.html" method="get">
|
|||
|
|
<input type="text" name="q" aria-labelledby="searchlabel" />
|
|||
|
|
<input type="submit" value="Go" />
|
|||
|
|
</form>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<script>$('#searchbox').show(0);</script>
|
|||
|
|
<p><h3><a href="index.html">Table of Contents</a></h3>
|
|||
|
|
<ul>
|
|||
|
|
<li><a class="reference internal" href="#">Choosing An SQL Server</a><ul>
|
|||
|
|
<li><a class="reference internal" href="#sqlite3">SQLite3</a><ul>
|
|||
|
|
<li><a class="reference internal" href="#install-of-sqlite3">Install of SQlite3</a></li>
|
|||
|
|
</ul>
|
|||
|
|
</li>
|
|||
|
|
<li><a class="reference internal" href="#postgresql">PostgreSQL</a><ul>
|
|||
|
|
<li><a class="reference internal" href="#install-and-initial-setup-of-postgresql">Install and initial setup of PostgreSQL</a></li>
|
|||
|
|
<li><a class="reference internal" href="#evennia-postgresql-configuration">Evennia PostgreSQL configuration</a></li>
|
|||
|
|
</ul>
|
|||
|
|
</li>
|
|||
|
|
<li><a class="reference internal" href="#mysql-mariadb">MySQL / MariaDB</a><ul>
|
|||
|
|
<li><a class="reference internal" href="#installing-and-initial-setup-of-mysql-mariadb">Installing and initial setup of MySQL/MariaDB</a></li>
|
|||
|
|
</ul>
|
|||
|
|
</li>
|
|||
|
|
<li><a class="reference internal" href="#add-mysql-configuration-to-evennia">Add MySQL configuration to Evennia</a></li>
|
|||
|
|
<li><a class="reference internal" href="#others">Others</a></li>
|
|||
|
|
</ul>
|
|||
|
|
</li>
|
|||
|
|
</ul>
|
|||
|
|
|
|||
|
|
<div role="note" aria-label="source link">
|
|||
|
|
<!--h3>This Page</h3-->
|
|||
|
|
<ul class="this-page-menu">
|
|||
|
|
<li><a href="_sources/Choosing-An-SQL-Server.md.txt"
|
|||
|
|
rel="nofollow">Show Page Source</a></li>
|
|||
|
|
</ul>
|
|||
|
|
</div><h3>Links</h3>
|
|||
|
|
<ul>
|
|||
|
|
<li><a href="https://www.evennia.com">Home page</a> </li>
|
|||
|
|
<li><a href="https://github.com/evennia/evennia">Evennia Github</a> </li>
|
|||
|
|
<li><a href="http://games.evennia.com">Game Index</a> </li>
|
|||
|
|
<li><a href="http://webchat.freenode.net/?channels=evennia&uio=MT1mYWxzZSY5PXRydWUmMTE9MTk1JjEyPXRydWUbb">IRC</a> -
|
|||
|
|
<a href="https://discord.gg/NecFePw">Discord</a> -
|
|||
|
|
<a href="https://groups.google.com/forum/#%21forum/evennia">Forums</a>
|
|||
|
|
</li>
|
|||
|
|
<li><a href="http://evennia.blogspot.com/">Evennia Dev blog</a> </li>
|
|||
|
|
</ul>
|
|||
|
|
<h3>Versions</h3>
|
|||
|
|
<ul>
|
|||
|
|
<li><a href="../1.0-dev/index.html">1.0-dev (develop branch)</a></li>
|
|||
|
|
<li><a href="Choosing-An-SQL-Server.html">0.9.5 (v0.9.5 branch)</a></li>
|
|||
|
|
</ul>
|
|||
|
|
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="clearer"></div>
|
|||
|
|
</div>
|
|||
|
|
<div class="related" role="navigation" aria-label="related navigation">
|
|||
|
|
<h3>Navigation</h3>
|
|||
|
|
<ul>
|
|||
|
|
<li class="right" style="margin-right: 10px">
|
|||
|
|
<a href="genindex.html" title="General Index"
|
|||
|
|
>index</a></li>
|
|||
|
|
<li class="right" >
|
|||
|
|
<a href="py-modindex.html" title="Python Module Index"
|
|||
|
|
>modules</a> |</li>
|
|||
|
|
<li class="nav-item nav-item-0"><a href="index.html">Evennia 0.9.5</a> »</li>
|
|||
|
|
<li class="nav-item nav-item-this"><a href="">Choosing An SQL Server</a></li>
|
|||
|
|
</ul>
|
|||
|
|
</div>
|
|||
|
|
<div class="footer" role="contentinfo">
|
|||
|
|
© Copyright 2020, The Evennia developer community.
|
|||
|
|
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.2.1.
|
|||
|
|
</div>
|
|||
|
|
</body>
|
|||
|
|
</html>
|