Skip to content

Change MySQL UTF-8 examples to use utf8mb4 #5100

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 8 commits into from
10 changes: 8 additions & 2 deletions book/doctrine.rst
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,21 @@ for you:
There's no way to configure these defaults inside Doctrine, as it tries to be
as agnostic as possible in terms of environment configuration. One way to solve
this problem is to configure server-level defaults.

.. caution::

If you are using MySQL, its `utf8` character set actually only supports
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In restructeredText, you have to use double backticks.

a portion of valid UTF-8 data that you may encounter. Instead, try to
use the newer `utf8mb4` if your system supports it.

Setting UTF8 defaults for MySQL is as simple as adding a few lines to
your configuration file (typically ``my.cnf``):

.. code-block:: ini

[mysqld]
collation-server = utf8_general_ci
character-set-server = utf8
collation-server = utf8mb4_general_ci
character-set-server = utf8mb4

.. note::

Expand Down