国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費(fèi)電子書等14項(xiàng)超值服

開通VIP
mysql中的數(shù)據(jù)編碼
mysql 4.1版本后,對(duì)編碼的支持大大加強(qiáng),這是它自己的說(shuō)法:

MySQL 4.1 can do these things for you: 

Store strings using a variety of character sets 

Compare strings using a variety of collations 

Mix strings with different character sets or collations in the same server, the same database, or even the same table 

Allow specification of character set and collation at any level 

In these respects, not only is MySQL 4.1 far more flexible than MySQL 4.0, it also is far ahead of other DBMSs

見(jiàn):http://dev.mysql.com/doc/mysql/en/charset-general.html


1 character set和collation的區(qū)別

character set表示字符集,也就是字符(character)和對(duì)應(yīng)的編碼(encoding)合稱為character set.

collation是字符間比較的方法,比如binaray, case sensitive, case insensitive。

2 character set, collation的設(shè)置

可以通過(guò)show variables like "%char"; show variables like "%collation%"分別查看當(dāng)前的設(shè)置情況。

在my.cnf文件中,可以使用:

character-set-server=utf8

collation-server-utf8

設(shè)置缺省server的character set, collation,這兩個(gè)選項(xiàng)從4.1.3版本開始有效。之前版本的設(shè)置方法:

default-character-set=utf8

default-collation=utf8

通過(guò)上面的設(shè)置后,show variables like "%char%"如下所示:

+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | latin1 |
| character_set_connection | latin1 |
| character_set_database | utf8 |
| character_set_results | latin1 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+


show variables like "%collation%"顯示:

+----------------------+-------------------+
| Variable_name | Value |
+----------------------+-------------------+
| collation_connection | latin1_swedish_ci |
| collation_database | utf8_general_ci |
| collation_server | utf8_general_ci |
+----------------------+-------------------+

3 問(wèn)題

我希望character-set-client, character-set-results,character-set-connection也是utf8, collation-connection也是utf8_general_ci,不知道在my.cnf中如何設(shè)置才能做到?

我目前都是先執(zhí)行set names 'utf8',再作進(jìn)一步查詢。

執(zhí)行set names 'utf8'后,show variables "%char%", show variables "%collation%"顯示所有的變量設(shè)置都是utf8的了。

本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
MySQL常用命令
又一次成功解決Mysql亂碼問(wèn)題 - 巴士飛揚(yáng)-技術(shù)BLOG
mysql創(chuàng)建數(shù)據(jù)庫(kù)指定字符集
pommo mailinglist - 網(wǎng)站設(shè)計(jì) - 設(shè)計(jì)管理在線 |設(shè)計(jì)管理至關(guān)重要|設(shè)...
MySQL字符集詳解
mysql導(dǎo)入導(dǎo)出數(shù)據(jù)中文亂碼解決方法小結(jié)
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長(zhǎng)圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服