MySQLÊý¾Ý¿âµÄdb.optÎļþ
MySQLµÄÿ¸öÊý¾Ý¿âĿ¼ÖÐÓÐÒ»¸öÎļþdb.opt,¸ÃÎļþÖ÷Òª ÓÃÀ´´æ´¢µ±Ç°Êý¾Ý¿âµÄĬÈÏ×Ö·û¼¯ºÍ×Ö·ûУÑé¹æÔò¡£
eg.default-character-set=latin1
default-collation=latin1_swedish_ci
¸ÃÎļþÖд洢µÄÊÇ´´½¨Êý¾Ý¿âʱĬÈϵÄ×Ö·û¼¯ºÍ×Ö·û¼¯Ð£Ñé¹æÔò£¬Ôò¸ÃÊý¾Ý¿âÔÚÒÔºó´´½¨±íʱÈç¹ûûÓÐÖ¸¶¨×Ö·û¼¯ºÍУÑé¹æÔò£¬Ôò¸Ã±íµÄÕâÁ½¸öÊôÐÔ½«È¥×ÔÕâÁ½¸ö±í¡£
MySQLÔ´Â룺
/* Set table default charset, if not set
SYNOPSIS
set_table_default_charset()
create_info Table create information
DESCRIPTION
If the table character set was not given explicitely,
let’s fetch the database default character set and
apply it to the table. */
static void set_table_default_charset(THD *thd,
HA_CREATE_INFO *create_info, char *db)
{
if (!create_info->default_table_charset)
{
HA_CREATE_INFO db_info;
load_db_opt_by_name(thd, db, &db_info);
create_info->default_table_charset= db_info.default_table_charset;
}
´´½¨Êý¾Ý¿âʱָ¶¨×Ö·û¼¯ºÍ×Ö·û¼¯Ð£Ñé¹æÔò£º
create database if not exists test default [charset|character set ] utf8
default collate utf8_general_ci;
ÐÞ¸ÄÊý¾Ý¿âµÄ×Ö·û¼¯ºÍ×Ö·û¼¯Ð£Ñé¹æÔò£º
alter database test default [charset|character set ] latin1 default collate
latin1_swedish_ci;
´´½¨Êý¾Ý¿âcreate database
CREATE {DATABASE | SCHEMA} [IF NOT EXISTS] db_name
[create_specification] …
create_specification:
[DEFAULT] CHARACTER SET [=] charset_name
| [DEFAULT] COLLATE [=] collation_name
Ò²¿ÉÒÔͨ¹ýalter databaseÐÞ¸Ä
ALTER {DATABASE | SCHEMA} [db_name]
alter_specification …
alter_specification:
[DEFAULT] CHARACTER SET [=] charset_name
| [DEFAULT] COLLATE [=] collation_name
±¾ÎÄÀ´×Ô£ºhttp://yubowei.blog.51cto.com/978243/282975
Ïà¹ØÎĵµ£º
×÷Õß: ÍõÕßÖ®½£(http://www.albertsong.com/) ÈÕÆÚ: 2008-01-05 22:10
×ÖÌå´óС: С ÖÐ ´ó
ʾÀýÑÝʾÁËÓÃC#²Ù×÷MySQLµÄ·½·¨£¬ÌṩÁËÈý¸ö¿ÉÖØÓõÄÀàMySqlDBUtil,MySqlPageUtil,Page¡£
±¾Ê¾ÀýÓÉ C#²Ù×÷AccessÊý¾Ý¿âµÄ¼òµ¥Àý×Ó£¨http://www.albertsong.com/read-56.html£©Ð޸ĶøÀ´¡£
1.Ê×ÏÈÏÂÔ ......
1.´Óhttp://prdownloads.sourceforge.net/mysqldrivercs/MySQLDriverCS-n-EasyQueryTools-3.0.18.exe?downloadÉÏÏÂÔØMySQLDriverCS.
2.°ÑMySQLDriverCS.dll.Ìí¼Óµ½.netµÄ×é¼þ
3.ʹÓ÷½·¨
ÏÂÃæÊÇ´´½¨Ò»¸öÊý¾Ý¿âÁ´½Ó:
ÏÂÃæÊÇ´´½¨Ò»¸öÊý¾Ý¿âÁ´½Ó:
using MySQLDriverCS;
MySQLConnection conn ......
Ò»¡¢Á¬½ÓMYSQL¡£
¸ñʽ£º mysql –hÖ÷»úµØÖ· –uÓû§Ãû £pÓû§ÃÜÂë
1¡¢Àý1£ºÁ¬½Óµ½±¾»úÉϵÄMYSQL¡£
Ê×ÏÈÔÚ´ò¿ªDOS´°¿Ú£¬È»ºó½øÈëĿ¼ mysqlbin£¬ÔÙ¼üÈëÃüÁîmysql -uroot -p£¬»Ø³µºóÌáʾÄãÊäÃÜÂ룬Èç¹û¸Õ°²×°ºÃMYSQL£¬³¬¼¶Óû§rootÊÇûÓÐÃÜÂëµÄ£¬¹ÊÖ±½Ó»Ø³µ¼´¿É½øÈëµ½MYSQLÖÐÁË£¬MYSQLµÄÌáʾ·ûÊÇ£º ......
ÍøÉϺܶàVCÁ¬½ÓmysqlµÄÀý×Ó¶¼ÊÇÒª´ø¸ölibmysql.dll²ÅÄÜÕý³£Ê¹Óõġ£
µ«ÓÐʱÎÒÃDz¢²»Ïë¶à´ø¸ölibmysql.dll£¬Ö»Ïëµ¥Îļþ¾ÍÄÜʹÓûòÕßÄãÊÇÒª
·â×°ÔÚÒ»¸ödllÎļþÀÕâʱÄãÒª¾ÍÓõ½mysqlclient.libÕâ¸ö¾²Ì¬¿âÁË¡£
ʾÀý´úÂëÈçÏ£¬ºÜºÜ¼òµ¥£¬¾Í²»¶à˵ÁË¡£
Ïà¹ØµÄmysqlÍ·Îļþ¼°¾²Ì¬¿â£º
http://download.csdn.net/source/1047 ......
MySQLµÄ×Ö·û¼¯Ö§³Ö(Character Set Support)ÓÐÁ½¸ö·½Ã棺
×Ö·û¼¯(Character set)ºÍÁ¬½ÓУ¶Ô(Collation)¡£
¶ÔÓÚ×Ö·û¼¯µÄÖ§³Öϸ»¯µ½Ëĸö²ã´Î:
·þÎñÆ÷(server)£¬Êý¾Ý¿â(database)£¬Êý¾Ý±í(table)ºÍÁ¬½Ó(connection)¡£
1.MySQLĬÈÏ×Ö·û¼¯
MySQL¶ÔÓÚ×Ö·û¼¯µÄ ......