Skip to content
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

Change MySQL UTF-8 examples to use utf8mb4 #5100

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 has some shortcomings
which may cause problems. Prefer the `utf8mb4` character set instead, if
your version supports it.
Copy link
Member

Choose a reason for hiding this comment

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

You will have to indented all these lines by four spaces to be rendered inside the enclosing sidebar block.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, I guess I did want to have a caution-block inside the sidebar-block, but offhand I'm not sure if that's a thing that is done elsewhere in the documentation.


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