0

Possible Duplicate:
How to make MySQL handle UTF-8 properly

  • I already created my database.
  • I don't want to do this in my.cfg.

    I want to run an SQL query to set utf-8 as my default on this database.

1
  • ALTER TABLE database.table CHARACTER SET utf8 COLLATE utf8_general_ci; will alter a tables encoding. This was taken from MySql administrator. Not sure about a DB with 1 command. Commented Jul 8, 2012 at 21:45

1 Answer 1

0

Once you start creating tables, it is no longer a single ALTER DATABASE statement. You need:

ALTER TABLE `foo`.`bar` CHARACTER SET utf8 COLLATION utf8_general_ci 

as already hinted in the comment. This changes the collation of all columns in the table to the specified one. However, it is also possible to control character set and collation also on column by column basis if desired.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.