Skip to content

Commit f980b33

Browse files
committed
added a note about database default charsets/collations
1 parent 480d574 commit f980b33

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

book/installation.rst

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,31 @@ If there are any issues, correct them now before moving on.
164164
Note that using the ACL is recommended when you have access to them
165165
on your server because changing the umask is not thread-safe.
166166

167+
.. sidebar:: Setting Up The Database
168+
169+
One mistake even seasoned developers make when starting a Symfony2 project
170+
is forgetting to setup default charset and collation on their database,
171+
ending up with latin type collations, which are default for most databases.
172+
They might even remember to do it the very first time, but forget that
173+
it's all gone after running a relatively common command during development:
174+
175+
:: code-block: bash
176+
177+
app/console doctrine:database:drop --force
178+
app/console doctrine:database:create
179+
180+
There's no way to configure these defaults inside doctrine, as it tries to be
181+
as agnostic as possible in terms of enviroment configuration, so only way around it
182+
is to configure server level defaults.
183+
184+
Setting UTF8 defaults for MySQL is as simple as adding a few lines to configuration file:
185+
186+
:: code-block: text
187+
188+
[mysqld]
189+
collation-server = utf8_general_ci
190+
character-set-server = utf8
191+
167192
When everything is fine, click on "Go to the Welcome page" to request your
168193
first "real" Symfony2 webpage:
169194

0 commit comments

Comments
 (0)