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