At 11:02 -0400 4/20/04, Stormblade wrote:
On Tue, 20 Apr 2004 09:21:00 -0500, Paul DuBois wrote:
At 9:38 -0400 4/20/04, Stormblade wrote:
On Tue, 20 Apr 2004 11:32:22 +0300, Victoria Reznichenko wrote:


Stormblade <[EMAIL PROTECTED]> wrote:
 Hopefully this will be the last snag...least till the next
 one :)


I'm having a problem setting the charset to unicode (utf-8). If I understood what I read I can set each table to support a charset. But what I want to do is set the default charset for a database to be utf-8. Is this possible? If so how?


Yes, it's possible from version 4.1.0.



CREATE DATABASE db_name DEFAULT CHARACTER SET utf8;



http://dev.mysql.com/doc/mysql/en/CREATE_DATABASE.html



Oh boy, that will be a pain. I use a GUI (Navicat and EMS MySQL Manager) and so far have not seen a way for me to make it create a table with a default character set. Nor even change it.


Um, what?



If you specify a default character set when you create a database, any table created in that database will have the same character set by default. Is that not what you are asking?

Yes and no. Whenever I go looking for MySQL help I generally see the
command-line or manual way of doing things. This lets me know that at least it's
possible. I wasn't even sure it was at the time I asked. So seeing the DDL for
database creation answered that.


However, I am not manually creating my databases. I have two GUI programs that I
am using. Since that is outside the scope of this list I was merely commenting
on the fact that I use these and that I hadn't seen a way to create a database
or table with a specified char set.

Okay. So that is an issue with those tools, not with MySQL.



I've already sent some messages to their technical support. But from this list I
really just wanted to know if it were possible and how to do it. I was hoping
that I could change a setting somewhere to make utf-8 the default char set used
for databases. Then I could see if Navicat or EMS MySQL Manager picked that up.

Well, that isn't quite what you asked above, where you asked if you could specify the default character set for "a database". For what you want, it might be better to change the server's default character set with the --default-character-set=utf8 option. For example, you can put this in an option file:

[mysqld]
default-character-set=utf8

That will cause utf8 to be the default character set for each database
(and table, column, string) to be utf8.  I don't know if you really want
that, but it's at least possible to do this.  It would not require the
GUI tools to be aware of the character set setting.


At this point though looks like I'll end up doing something else like creating all my tables and such then somehow exporting or copy and pasting the DLL for them all, modifying them so that it uses utf-8 and re-creating everything.

-- Paul DuBois, MySQL Documentation Team Madison, Wisconsin, USA MySQL AB, www.mysql.com

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to