@@ -78,6 +78,32 @@ information. By convention, this information is usually configured in an
78
78
of your project, like inside your Apache configuration, for example. For
79
79
more information, see :doc: `/cookbook/configuration/external_parameters `.
80
80
81
+ .. sidebar :: Setting Up The Database
82
+
83
+ One mistake even seasoned developers make when starting a Symfony2 project
84
+ is forgetting to setup default charset and collation on their database,
85
+ ending up with latin type collations, which are default for most databases.
86
+ They might even remember to do it the very first time, but forget that
87
+ it's all gone after running a relatively common command during development:
88
+
89
+ .. code-block :: bash
90
+
91
+ $ app/console doctrine:database:drop --force
92
+ $ app/console doctrine:database:create
93
+
94
+ There's no way to configure these defaults inside doctrine, as it tries to be
95
+ as agnostic as possible in terms of enviroment configuration, so only way around it
96
+ is to configure server level defaults.
97
+
98
+ Setting UTF8 defaults for MySQL is as simple as adding a few lines to configuration file
99
+ (typically ``my.cnf ``):
100
+
101
+ .. code-block :: ini
102
+
103
+ [mysqld]
104
+ collation-server = utf8_general_ci
105
+ character-set-server = utf8
106
+
81
107
Now that Doctrine knows about your database, you can have it create the database
82
108
for you:
83
109
0 commit comments