十年網(wǎng)站開發(fā)經(jīng)驗 + 多家企業(yè)客戶 + 靠譜的建站團隊
量身定制 + 運營維護+專業(yè)推廣+無憂售后,網(wǎng)站問題一站解決
這篇文章主要介紹了MySQL如何查詢表的字符集編碼的相關(guān)知識,內(nèi)容詳細(xì)易懂,操作簡單快捷,具有一定借鑒價值,相信大家閱讀完這篇mysql如何查詢表的字符集編碼文章都會有所收獲,下面我們一起來看看吧。
成都創(chuàng)新互聯(lián)公司是一家集網(wǎng)站建設(shè),張北企業(yè)網(wǎng)站建設(shè),張北品牌網(wǎng)站建設(shè),網(wǎng)站定制,張北網(wǎng)站建設(shè)報價,網(wǎng)絡(luò)營銷,網(wǎng)絡(luò)優(yōu)化,張北網(wǎng)站推廣為一體的創(chuàng)新建站企業(yè),幫助傳統(tǒng)企業(yè)提升企業(yè)形象加強企業(yè)競爭力??沙浞譂M足這一群體相比中小企業(yè)更為豐富、高端、多元的互聯(lián)網(wǎng)需求。同時我們時刻保持專業(yè)、時尚、前沿,時刻以成就客戶成長自我,堅持不斷學(xué)習(xí)、思考、沉淀、凈化自己,讓我們?yōu)楦嗟钠髽I(yè)打造出實用型網(wǎng)站。
mysql查詢表字符集編碼的兩種方法:1、使用“show table status”語句查看指定數(shù)據(jù)庫中指定表的字符集編碼,語法“show table status from 庫名 like 表名;”。2、使用“show columns”語句配合full關(guān)鍵字查看當(dāng)前數(shù)據(jù)庫中指定表所有列的字符集編碼,語法“show full columns from 表名;”。
本教程操作環(huán)境:windows7系統(tǒng)、mysql8版本、Dell G3電腦。
mysql查詢表字符集編碼的兩種方法
1、使用show table status語句查看指定表的字符集編碼
SHOW TABLE STATUS命令可以獲取指定數(shù)據(jù)庫中每個數(shù)據(jù)表的信息,包括字符集編碼。
show table status from 數(shù)據(jù)庫名;
但只想獲取指定表的信息,就可利用like進行限制:
show table status from 庫名 like 表名;
示例:查看class_7數(shù)據(jù)庫中test_info表的字符集編碼
show table status from class_7 like 'test_info';
mysql> show table status from class_7 like 'test_info'; +-----------+--------+---------+------------+------+----------------+-------------------------+-------------+------------+-----------------+----------+- | Name | Engine | Version | Row_format | Rows | Avg_row_length | Data_leate_time | Update_time | Check_time | Collation | Checksum | +-----------+--------+---------+------------+------+----------------+-------------------------+-------------+------------+-----------------+----------+- | test_info | InnoDB | 10 | Compact | 10 | 1638 | 17-12-05 19:01:55 | NULL | NULL | utf8_general_ci | NULL | +-----------+--------+---------+------------+------+----------------+-------------------------+-------------+------------+-----------------+----------+- 1 row in set (0.00 sec)

2、使用show columns語句配合full關(guān)鍵字查看當(dāng)前數(shù)據(jù)庫中指定表中所有列的字符集編碼
在mysql中,SHOW COLUMNS命令可以顯示表的列信息,而要獲取有關(guān)列的更多信息,請將FULL關(guān)鍵字添加到SHOW COLUMNS命令中:
show full columns from 表名;
該語句可以輸出指定表中所有列的字符集編碼
示例:查看test_info表中所有列的字符集編碼
show full columns from test_info;
mysql> show full columns from test_info; +-------+----------+-----------------+------+-----+---------+-------+---------------------------------+---------+ | Field | Type | Collation | Null | Key | Default | Extra | Privileges | Comment | +-------+----------+-----------------+------+-----+---------+-------+---------------------------------+---------+ | id | int(3) | NULL | NO | PRI | NULL | | select,insert,update,references | | | name | char(12) | utf8_general_ci | YES | | NULL | | select,insert,update,references | | | dorm | char(10) | utf8_general_ci | YES | | NULL | | select,insert,update,references | | | addr | char(12) | utf8_general_ci | YES | | 未知 | | select,insert,update,references | | | score | int(3) | NULL | YES | | NULL | | select,insert,update,references | | +-------+----------+-----------------+------+-----+---------+-------+---------------------------------+---------+ 5 rows in set (0.00 sec)

關(guān)于“mysql如何查詢表的字符集編碼”這篇文章的內(nèi)容就介紹到這里,感謝各位的閱讀!相信大家對“mysql如何查詢表的字符集編碼”知識都有一定的了解,大家如果還想學(xué)習(xí)更多知識,歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道。