From dd432e099b559202851ae426d167bd2e30ec5239 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Lebleu?= Date: Mon, 11 May 2020 12:52:12 +0200 Subject: [PATCH] Complete doc of database setup --- doc/manual_installation/modoboa.rst | 34 +++++++++++++++++++---------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/doc/manual_installation/modoboa.rst b/doc/manual_installation/modoboa.rst index a1281a722..163a236c0 100644 --- a/doc/manual_installation/modoboa.rst +++ b/doc/manual_installation/modoboa.rst @@ -77,42 +77,52 @@ Thanks to Django, Modoboa is compatible with the following databases: * SQLite Since the last one does not require particular actions, only the first -two ones are described. +two ones are described. You should also read the notes for those database +backends on the `official Django documentation +`_. PostgreSQL ********** Install the corresponding Python binding: -.. sourcecode:: bash +.. code-block:: console - (env)> pip install psycopg2 + (env)$ pip install psycopg2 -Then, create a user and a database: -.. sourcecode:: bash - > sudo -i -u postgres - > +Then, create a user and a database. For example, to create the ``modoboa`` +database owned by a ``modoboa`` user, run the following commands on your +PostgreSQL server: + +.. code-block:: console + + # sudo -l -u postgres createuser --no-createdb modoboa + # sudo -l -u postgres createdb --owner=modoboa modoboa MySQL / MariaDB *************** Install the corresponding Python binding: -.. sourcecode:: bash +.. code-block:: console + + (env)$ pip install mysqlclient - (env)> pip install mysqlclient .. note:: MariaDB 10.2 (and newer) require mysqlclient 1.3.11 (or newer). -Then, create a user and a database: +Then, create a user and a database. For example, to create the ``modoboa`` +database owned by a ``modoboa`` user, run the following SQL commands: -.. sourcecode:: bash +.. code-block:: mysql - > mysqladmin -u root -p create modoboa + CREATE DATABASE modoboa; + CREATE USER 'modoboa'@'localhost' IDENTIFIED BY 'my-strong-password-here'; + GRANT ALL PRIVILEGES ON modoboa.* TO 'modoboa'@'localhost'; Deploy an instance ------------------