Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

In an effort to set the default charset for a MySQL server to utf8, I've added the following options to my.ini

character-set-server=utf8
default-collation=utf8_unicode_ci

But when I start the mysql client, I get the following error message:

error: Found option without preceding group in config file: C:\dev\tools\mysql\my.ini at line: 2 Fatal error in defaults handling. Program aborted

Does anyone know what the right way to set the default charset in this config file is?

Thanks, Don

share|improve this question
add comment

1 Answer 1

The problem the server complains about is that it can't find the expected INI section ([mysqld]) to which these settings belong. Ensure you've added those settings to the [mysqld] section, like this:

[mysqld]
character-set-server=utf8
default-collation=utf8_unicode_ci

If there's already such a section there, add your settings to to that section, don't create a duplicate section.

After altering the configuration file, restart the MySQL server.

share|improve this answer
1  
Yeah, what I would call a section (i.e. [mysqld] or [client]) is referred to as a group in MySQL-speak: dev.mysql.com/doc/refman/6.0/en/option-files.html –  Philip Durbin May 13 '09 at 20:21
    
Thanks, wasn't familiar with that terminology :) Me called it like me seen it :) –  Mihai Limbăşan May 13 '09 at 20:24
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.