Skip to content

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

Merged
merged 5 commits into from
Jul 29, 2012
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions book/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Member

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:

.. code-block:: bash


app/console doctrine:database:drop --force
app/console doctrine:database:create
Copy link
Member

Choose a reason for hiding this comment

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

You should place a $ in front of every bash line


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:
Copy link
Member

Choose a reason for hiding this comment

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

I would mention the filename here at least (my.cnf), but you're right not to mention the full path.


:: code-block: text

[mysqld]
collation-server = utf8_general_ci
character-set-server = utf8
Copy link
Member

Choose a reason for hiding this comment

The 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
And I think this code is an ini document, not a text document.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

configuration file location varies on distribution and operating system.


Copy link
Contributor

Choose a reason for hiding this comment

The 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:

Expand Down