Refs #29548 -- Updated docs for MariaDB support.
This commit is contained in:
parent
5ec44973dc
commit
b6c4766f53
@ -340,5 +340,4 @@ class DatabaseWrapper(BaseDatabaseWrapper):
|
|||||||
|
|
||||||
@cached_property
|
@cached_property
|
||||||
def mysql_is_mariadb(self):
|
def mysql_is_mariadb(self):
|
||||||
# MariaDB isn't officially supported.
|
|
||||||
return 'mariadb' in self.mysql_server_info.lower()
|
return 'mariadb' in self.mysql_server_info.lower()
|
||||||
|
@ -30,10 +30,12 @@ popular alternatives.
|
|||||||
|
|
||||||
If you want to use Django with a database, which is probably the case, you'll
|
If you want to use Django with a database, which is probably the case, you'll
|
||||||
also need a database engine. PostgreSQL_ is recommended, because we're
|
also need a database engine. PostgreSQL_ is recommended, because we're
|
||||||
PostgreSQL fans, and MySQL_, `SQLite`_, and Oracle_ are also supported.
|
PostgreSQL fans, and MariaDB_, MySQL_, `SQLite`_, and Oracle_ are also
|
||||||
|
supported.
|
||||||
|
|
||||||
.. _Python: https://www.python.org/
|
.. _Python: https://www.python.org/
|
||||||
.. _PostgreSQL: https://www.postgresql.org/
|
.. _PostgreSQL: https://www.postgresql.org/
|
||||||
|
.. _MariaDB: https://mariadb.org/
|
||||||
.. _MySQL: https://www.mysql.com/
|
.. _MySQL: https://www.mysql.com/
|
||||||
.. _`SQLite`: https://www.sqlite.org/
|
.. _`SQLite`: https://www.sqlite.org/
|
||||||
.. _Oracle: https://www.oracle.com/
|
.. _Oracle: https://www.oracle.com/
|
||||||
|
@ -31,8 +31,8 @@ Set up a database
|
|||||||
=================
|
=================
|
||||||
|
|
||||||
This step is only necessary if you'd like to work with a "large" database engine
|
This step is only necessary if you'd like to work with a "large" database engine
|
||||||
like PostgreSQL, MySQL, or Oracle. To install such a database, consult the
|
like PostgreSQL, MariaDB, MySQL, or Oracle. To install such a database, consult
|
||||||
:ref:`database installation information <database-installation>`.
|
the :ref:`database installation information <database-installation>`.
|
||||||
|
|
||||||
Install Django
|
Install Django
|
||||||
==============
|
==============
|
||||||
|
@ -94,9 +94,9 @@ and creates any necessary database tables according to the database settings
|
|||||||
in your :file:`mysite/settings.py` file and the database migrations shipped
|
in your :file:`mysite/settings.py` file and the database migrations shipped
|
||||||
with the app (we'll cover those later). You'll see a message for each
|
with the app (we'll cover those later). You'll see a message for each
|
||||||
migration it applies. If you're interested, run the command-line client for your
|
migration it applies. If you're interested, run the command-line client for your
|
||||||
database and type ``\dt`` (PostgreSQL), ``SHOW TABLES;`` (MySQL), ``.schema``
|
database and type ``\dt`` (PostgreSQL), ``SHOW TABLES;`` (MariaDB, MySQL),
|
||||||
(SQLite), or ``SELECT TABLE_NAME FROM USER_TABLES;`` (Oracle) to display the
|
``.schema`` (SQLite), or ``SELECT TABLE_NAME FROM USER_TABLES;`` (Oracle) to
|
||||||
tables Django created.
|
display the tables Django created.
|
||||||
|
|
||||||
.. admonition:: For the minimalists
|
.. admonition:: For the minimalists
|
||||||
|
|
||||||
|
@ -268,6 +268,18 @@ non-durable <https://www.postgresql.org/docs/current/non-durability.html>`_.
|
|||||||
a development machine where you can easily restore the entire contents of
|
a development machine where you can easily restore the entire contents of
|
||||||
all databases in the cluster.
|
all databases in the cluster.
|
||||||
|
|
||||||
|
.. _mariadb-notes:
|
||||||
|
|
||||||
|
MariaDB notes
|
||||||
|
=============
|
||||||
|
|
||||||
|
.. versionadded:: 3.0
|
||||||
|
|
||||||
|
Django supports MariaDB 10.1 and higher.
|
||||||
|
|
||||||
|
To use MariaDB, use the MySQL backend, which is shared between the two. See the
|
||||||
|
:ref:`MySQL notes <mysql-notes>` for more details.
|
||||||
|
|
||||||
.. _mysql-notes:
|
.. _mysql-notes:
|
||||||
|
|
||||||
MySQL notes
|
MySQL notes
|
||||||
|
@ -72,7 +72,7 @@ If your database table name is an SQL reserved word, or contains characters that
|
|||||||
aren't allowed in Python variable names -- notably, the hyphen -- that's OK.
|
aren't allowed in Python variable names -- notably, the hyphen -- that's OK.
|
||||||
Django quotes column and table names behind the scenes.
|
Django quotes column and table names behind the scenes.
|
||||||
|
|
||||||
.. admonition:: Use lowercase table names for MySQL
|
.. admonition:: Use lowercase table names for MariaDB and MySQL
|
||||||
|
|
||||||
It is strongly advised that you use lowercase table names when you override
|
It is strongly advised that you use lowercase table names when you override
|
||||||
the table name via ``db_table``, particularly if you are using the MySQL
|
the table name via ``db_table``, particularly if you are using the MySQL
|
||||||
|
@ -487,7 +487,7 @@ SQLite. This can be configured using the following::
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
When connecting to other database backends, such as MySQL, Oracle, or
|
When connecting to other database backends, such as MariaDB, MySQL, Oracle, or
|
||||||
PostgreSQL, additional connection parameters will be required. See
|
PostgreSQL, additional connection parameters will be required. See
|
||||||
the :setting:`ENGINE <DATABASE-ENGINE>` setting below on how to specify
|
the :setting:`ENGINE <DATABASE-ENGINE>` setting below on how to specify
|
||||||
other database types. This example is for PostgreSQL::
|
other database types. This example is for PostgreSQL::
|
||||||
|
@ -38,6 +38,12 @@ compatible with Django 3.0.
|
|||||||
What's new in Django 3.0
|
What's new in Django 3.0
|
||||||
========================
|
========================
|
||||||
|
|
||||||
|
MariaDB support
|
||||||
|
---------------
|
||||||
|
|
||||||
|
Django now officially supports `MariaDB <https://mariadb.org/>`_ 10.1 and
|
||||||
|
higher. See :ref:`MariaDB notes <mariadb-notes>` for more details.
|
||||||
|
|
||||||
Minor features
|
Minor features
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ stored in the model tablespace ``tables`` by default. The index for the
|
|||||||
Database support
|
Database support
|
||||||
================
|
================
|
||||||
|
|
||||||
PostgreSQL and Oracle support tablespaces. SQLite and MySQL don't.
|
PostgreSQL and Oracle support tablespaces. SQLite, MariaDB and MySQL don't.
|
||||||
|
|
||||||
When you use a backend that lacks support for tablespaces, Django ignores all
|
When you use a backend that lacks support for tablespaces, Django ignores all
|
||||||
tablespace-related options.
|
tablespace-related options.
|
||||||
|
@ -69,8 +69,8 @@ Get your database running
|
|||||||
|
|
||||||
If you plan to use Django's database API functionality, you'll need to make
|
If you plan to use Django's database API functionality, you'll need to make
|
||||||
sure a database server is running. Django supports many different database
|
sure a database server is running. Django supports many different database
|
||||||
servers and is officially supported with PostgreSQL_, MySQL_, Oracle_ and
|
servers and is officially supported with PostgreSQL_, MariaDB_, MySQL_, Oracle_
|
||||||
SQLite_.
|
and SQLite_.
|
||||||
|
|
||||||
If you are developing a simple project or something you don't plan to deploy
|
If you are developing a simple project or something you don't plan to deploy
|
||||||
in a production environment, SQLite is generally the simplest option as it
|
in a production environment, SQLite is generally the simplest option as it
|
||||||
@ -89,7 +89,7 @@ database bindings are installed.
|
|||||||
* If you're using PostgreSQL, you'll need the `psycopg2`_ package. Refer to the
|
* If you're using PostgreSQL, you'll need the `psycopg2`_ package. Refer to the
|
||||||
:ref:`PostgreSQL notes <postgresql-notes>` for further details.
|
:ref:`PostgreSQL notes <postgresql-notes>` for further details.
|
||||||
|
|
||||||
* If you're using MySQL, you'll need a :ref:`DB API driver
|
* If you're using MySQL or MariaDB, you'll need a :ref:`DB API driver
|
||||||
<mysql-db-api-drivers>` like ``mysqlclient``. See :ref:`notes for the MySQL
|
<mysql-db-api-drivers>` like ``mysqlclient``. See :ref:`notes for the MySQL
|
||||||
backend <mysql-notes>` for details.
|
backend <mysql-notes>` for details.
|
||||||
|
|
||||||
@ -116,6 +116,7 @@ If you're using Django's :doc:`testing framework</topics/testing/index>` to test
|
|||||||
database queries, Django will need permission to create a test database.
|
database queries, Django will need permission to create a test database.
|
||||||
|
|
||||||
.. _PostgreSQL: https://www.postgresql.org/
|
.. _PostgreSQL: https://www.postgresql.org/
|
||||||
|
.. _MariaDB: https://mariadb.org/
|
||||||
.. _MySQL: https://www.mysql.com/
|
.. _MySQL: https://www.mysql.com/
|
||||||
.. _psycopg2: http://initd.org/psycopg/
|
.. _psycopg2: http://initd.org/psycopg/
|
||||||
.. _SQLite: https://www.sqlite.org/
|
.. _SQLite: https://www.sqlite.org/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user