-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
added a note about database default charsets/collations #1563
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
Changes from 1 commit
f980b33
d49413b
5cc79af
8ab049a
9f10837
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -164,6 +164,31 @@ If there are any issues, correct them now before moving on. | |
Note that using the ACL is recommended when you have access to them | ||
on your server because changing the umask is not thread-safe. | ||
|
||
.. sidebar:: Setting Up The Database | ||
|
||
One mistake even seasoned developers make when starting a Symfony2 project | ||
is forgetting to setup default charset and collation on their database, | ||
ending up with latin type collations, which are default for most databases. | ||
They might even remember to do it the very first time, but forget that | ||
it's all gone after running a relatively common command during development: | ||
|
||
:: code-block: bash | ||
|
||
app/console doctrine:database:drop --force | ||
app/console doctrine:database:create | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You should place a |
||
|
||
There's no way to configure these defaults inside doctrine, as it tries to be | ||
as agnostic as possible in terms of enviroment configuration, so only way around it | ||
is to configure server level defaults. | ||
|
||
Setting UTF8 defaults for MySQL is as simple as adding a few lines to configuration file: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would mention the filename here at least ( |
||
|
||
:: code-block: text | ||
|
||
[mysqld] | ||
collation-server = utf8_general_ci | ||
character-set-server = utf8 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please specify the location of the file with a comment, as discribed here: #1531 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. configuration file location varies on distribution and operating system. |
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. extra blank spaces here |
||
When everything is fine, click on "Go to the Welcome page" to request your | ||
first "real" Symfony2 webpage: | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The format on these 2 code blocks isn't quite right - it should look like this: