国产欧美一区二区精品行性色_91精品午夜在线观看_亚洲精品无码激情国产_91精品啪在线观看国产城中村_91看片国产一区二区色欲

始創(chuàng)于2000年 股票代碼:831685
咨詢熱線:0371-60135900 注冊(cè)有禮 登錄
  • 掛牌上市企業(yè)
  • 60秒人工響應(yīng)
  • 99.99%連通率
  • 7*24h人工
  • 故障100倍補(bǔ)償
全部產(chǎn)品
您的位置: 網(wǎng)站首頁 > 幫助中心>文章內(nèi)容

MySQL數(shù)據(jù)庫的db.opt文件

發(fā)布時(shí)間:  2012/8/21 16:47:40

MySQL的每個(gè)數(shù)據(jù)庫目錄中有一個(gè)文件db.opt,該文件主要 用來存儲(chǔ)當(dāng)前數(shù)據(jù)庫的默認(rèn)字符集和字符校驗(yàn)規(guī)則。

eg.default-character-set=latin1
default-collation=latin1_swedish_ci

該文件中存儲(chǔ)的是創(chuàng)建數(shù)據(jù)庫時(shí)默認(rèn)的字符集和字符集校驗(yàn)規(guī)則,則該數(shù)據(jù)庫在以后創(chuàng)建表時(shí)如果沒有指定字符集和校驗(yàn)規(guī)則,則該表的這兩個(gè)屬性將去自這兩個(gè)表。

 

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;
}
創(chuàng)建數(shù)據(jù)庫時(shí)指定字符集和字符集校驗(yàn)規(guī)則:
create database if not exists test default [charset|character set ] utf8 default collate utf8_general_ci;
修改數(shù)據(jù)庫的字符集和字符集校驗(yàn)規(guī)則:
alter database test default [charset|character set ] latin1 default collate latin1_swedish_ci;
創(chuàng)建數(shù)據(jù)庫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


本文出自:億恩科技【www.cmtents.com】

 

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;
}
創(chuàng)建數(shù)據(jù)庫時(shí)指定字符集和字符集校驗(yàn)規(guī)則:
create database if not exists test default [charset|character set ] utf8 default collate utf8_general_ci;
修改數(shù)據(jù)庫的字符集和字符集校驗(yàn)規(guī)則:
alter database test default [charset|character set ] latin1 default collate latin1_swedish_ci;
創(chuàng)建數(shù)據(jù)庫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


本文出自:億恩科技【www.enidc.com】
-->

服務(wù)器租用/服務(wù)器托管中國五強(qiáng)!虛擬主機(jī)域名注冊(cè)頂級(jí)提供商!15年品質(zhì)保障!--億恩科技[ENKJ.COM]

  • 您可能在找
  • 億恩北京公司:
  • 經(jīng)營性ICP/ISP證:京B2-20150015
  • 億恩鄭州公司:
  • 經(jīng)營性ICP/ISP/IDC證:豫B1.B2-20060070
  • 億恩南昌公司:
  • 經(jīng)營性ICP/ISP證:贛B2-20080012
  • 服務(wù)器/云主機(jī) 24小時(shí)售后服務(wù)電話:0371-60135900
  • 虛擬主機(jī)/智能建站 24小時(shí)售后服務(wù)電話:0371-60135900
  • 專注服務(wù)器托管17年
    掃掃關(guān)注-微信公眾號(hào)
    0371-60135900
    Copyright© 1999-2019 ENKJ All Rights Reserved 億恩科技 版權(quán)所有  地址:鄭州市高新區(qū)翠竹街1號(hào)總部企業(yè)基地億恩大廈  法律顧問:河南亞太人律師事務(wù)所郝建鋒、杜慧月律師   京公網(wǎng)安備41019702002023號(hào)
      0
     
     
     
     

    0371-60135900
    7*24小時(shí)客服服務(wù)熱線