mysql> status;
--------------
mysql Ver 14.12 Distrib 5.0.51a, for debian-linux-gnu (i486) using readline 5.2
Connection id: 226
Current database: taxi
Current user: root@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 5.0.51a-24+lenny4 (Debian)
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: latin1
Db characterset: utf8
Client characterset: latin1
Conn. characterset: latin1
UNIX socket: /var/run/mysqld/mysqld.sock
Uptime: 1 day 41 min 6 sec
Threads: 1 Questions: 1068 Slow queries: 0 Opens: 665 Flush tables: 1 Open tables: 64 Queries per second avg: 0.012
--------------
原本粗體全部為latin1, 用alter database db_name collate utf8_unicode_ci;
Db Characterset變為utf8.
用set names uft8;則Client 及 Conn. Characterset 都變為utf8
寫的PHP網頁由DB提取中文字出現問號, 在mysql console 下亦以問號(同debian無裝中文有關).phpmyadmin下insert 同select 都可以正常顯示,create table 時已加character set = utf8, 尚在處理中...
試左一輪, 响mysql同php連線前用mysql_query("set names utf8;");則之後的query 的中文正確顯示不再出現問號
參考以下几個網頁
資料庫內,某個 table 內某個 column 的 collation 錯誤造成無法儲存中文
http://0rz.tw/6NWaF
MySQL中文編碼徹底研究 *有點舊,但中文原理講得詳細
http://tw.myblog.yahoo.com/waian-950604/article?mid=1631&prev=1636&next=1630
mysql插入中文出乱码
http://www.nowamagic.net/database/db_CharsetPrinciple.php
让MYSQL彻底支持中文(slack10.1版)
http://slack.linuxsir.org/main/?q=node/165
MySQL參考手冊 第10章:字符集支持
http://dev.mysql.com/doc/refman/5.1/zh/charset.html
9.1.4. Connection Character Sets and Collations
http://dev.mysql.com/doc/refman/5.0/en/charset-connection.html
php 解决乱码的通用方法
http://blog.51yip.com/php/572.html
InnoDB 匯入時關閉 Foreign Key 檢查及支援UTF8 (在SQL滙入的文件中加入)
http://jax-work-archive.blogspot.com/2009/07/innodb-foreign-key-mysql.html
SET FOREIGN_KEY_CHECKS = 0; //0 turn off
SET NAMES 'UTF8';
mysqldump & mysql command for UTF-8 database
http://jax-work-archive.blogspot.com/2011/01/mysql-mysqldump-mysql-command-for-utf-8.html
utf8中文编码范围
詳細介紹UTF8中文及原理及例子
http://www.sphinxsearch.org/archives/40
Thursday, April 14, 2011
Subscribe to:
Post Comments (Atom)
13 comments:
purchase cialis cialis 70 ans - cialis 20mg online kaufen
buy tramadol 6 50 mg tramadol - tramadol online next day delivery
buy tramadol buy tramadol online in usa - cheap tramadol with no prescription
best buy tramadol tramadol 50mg ratiopharm - buy tramadol online australia no prescription
http://buytramadolonlinecool.com/#56411 buy tramadol with credit card - buy tramadol cod online
buy tramadol without rx generic tramadol 50 mg - tramadol ibuprofen
buy tramadol online tramadol withdrawal forum - tramadol online no prescription fedex
buy tramadol tramadol 50 mg vs tylenol #3 - tramadol 50 mg generic ultram
http://blog.dawn.com/dblog/buy/#40751 tramadol for dogs generic - tramadol addiction message board
buy tramadol online no prescription cheap tramadol hydrochloride 100mg/2ml - buy 180 tramadol online
http://reidmoody.com/#51208 legal buy ativan online - ativan side effects pediatric
buy tramadol online tramadol 50mg an 627 - tramadol overdose do
http://ranchodelastortugas.com/#82165 xanax alprazolam 0.5mg - xanax side effects eyes
Post a Comment