How can I change variables?

Hello guys,

I’d like to change these MySQL global variables:

character_set_database=utf8
character_set_server=utf8
collation_database=utf8_general_ci
collation_server=utf8_general_ci

How can I do this? I’ve tried to put these lines into my.cnf and restart server, but MySQL service doesn’t start with these lines.

you can’t change the _database “variables” in the my.cnf file. you have to change that with the ALTER DATABASE statement.

see http://dev.mysql.com/doc/refman/5.0/en/charset-server.html for the correct syntax for specifying the server collation and character set.

Thanks for link.

I’ve tried:
mysqld --character-set-server=latin1

But it seems there is no mysqld on my system.

Then I’ve tried to enter these lines in mysql console (shell> mysql):
character_set_database=utf8
character_set_server=utf8
collation_database=utf8_general_ci
collation_server=utf8_general_ci

But it didn’t change anything. :frowning:

I can’t configure MySQL, I’m sure I will just kill my MySQL setup.

Is there any other way to change these variables?

dude, you’ve got it completely wrong.

as i said before, you can’t change the character_set_database and collation_database=utf8_general_ci variables. you have to change the database character set or collation using the ALTER DATABASE statement.

the character_set_server and collation_server statements can be added to the my.cnf or my.ini and then reboot the server.

Thanks. These 2 lines set variables to utf8. :slight_smile:

Alter database also worked. So I’ve solved all problems with importing UTF-8 data. Awesome!

Thanks again.

Hello,

I’ve add those lines in my.ini:
[mysqld]
collation_server=utf8_unicode_ci
character_set_server=utf8

And rebooted the server but nothing changed.
When I looked with:
SHOW VARIABLES LIKE ‘character_set%’;

This appear:
character_set_client utf8
character_set_connection utf8
character_set_database latin1
character_set_filesystem binary
character_set_results utf8
character_set_server latin1
character_set_system utf8
character_sets_dir C:\Program Files\EasyPHP3.1\mysql\share\charsets\

Coulf someone tell me why??? (I’m a bit stuck :injured:)

Thankssssss