青草久久影院-青草久久伊人-青草久久久-青草久久精品亚洲综合专区-SM双性精跪趴灌憋尿调教H-SM脚奴调教丨踩踏贱奴

17站長網

17站長網 首頁 數據庫 Mysql 查看內容

查看MySQL字符集的三種方法

2023-3-16 15:46| 查看: 3360 |來源: 互聯網

MySQL字符集設置系統變量:– character_set_server:默認的內部操作字符集– character_set_client:客戶端來源數據使用的字符集– character_set_connection: ...

MySQL字符集設置

系統變量:

– character_set_server:默認的內部操作字符集

– character_set_client:客戶端來源數據使用的字符集

– character_set_connection:連接層字符集

– character_set_results:查詢結果字符集

– character_set_database:當前選中數據庫的默認字符集

– character_set_system:系統元數據(字段名等)字符集

– 還有以collation_開頭的同上面對應的變量,用來描述字符序。

       登陸MySQL數據庫:

C:/Users/duansf>mysql -u root -p

Enter password: ******

Welcome to the MySQL monitor.  Commands end with ; or /g.

Your MySQL connection id is 4

Server version: 5.5.13 MySQL Community Server (GPL)

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.

Type 'help;' or '/h' for help. Type '/c' to clear the current input statement.

mysql>

一.查看MySQL數據庫服務器和數據庫MySQL的字符集:

mysql> show variables like '%char%';

+--------------------------+---------------------------------------------------------------+

| Variable_name            | Value                                                         |

+--------------------------+---------------------------------------------------------------+

| character_set_client     | utf8                                                          |

| character_set_connection | utf8                                                          |

| character_set_database   | gbk                                                           |

| character_set_filesystem | binary                                                        |

| character_set_results    | utf8                                                          |

| character_set_server     | utf8                                                          |

| character_set_system     | utf8                                                          |

| character_sets_dir       | C:/Program Files (x86)/MySQL/MySQL Server 5.5/share/charsets/ |

+--------------------------+---------------------------------------------------------------+

8 rows in set (0.00 sec)

二.查看MySQL數據表(table)的MySQL字符集:

mysql> use test

Database changed

mysql> show table status from test like '%work%';

+----------+--------+---------+------------+------+----------------+-------------+-----------------+

--------------+-----------+----------------+---------------------+-------------+------------+-------

----------+----------+----------------+---------+

| Name     | Engine | Version | Row_format | Rows | Avg_row_length | Data_length | Max_data_length |

 Index_length | Data_free | Auto_increment | Create_time         | Update_time | Check_time | Collat

ion       | Checksum | Create_options | Comment |

+----------+--------+---------+------------+------+----------------+-------------+-----------------+

--------------+-----------+----------------+---------------------+-------------+------------+-------

----------+----------+----------------+---------+

| workinfo | InnoDB |      10 | Compact    |    1 |          16384 |       16384 |               0 |

        32768 |   9437184 |              4 | 2016-03-07 16:13:51 | NULL        | NULL       | utf8_g

eneral_ci |     NULL |                |         |

+----------+--------+---------+------------+------+----------------+-------------+-----------------+

--------------+-----------+----------------+---------------------+-------------+------------+-------

----------+----------+----------------+---------+

1 row in set (0.00 sec)

三.查看MySQL數據列(column)的MySQL字符集:

mysql> show full columns from workinfo;

+----------+-------------+-----------------+------+-----+---------+----------------+----------------

-----------------+---------+

| Field    | Type        | Collation       | Null | Key | Default | Extra          | Privileges

                 | Comment |

+----------+-------------+-----------------+------+-----+---------+----------------+----------------

-----------------+---------+

| id       | int(10)     | NULL            | NO   | PRI | NULL    | auto_increment | select,insert,u

pdate,references |         |

| name     | varchar(20) | utf8_general_ci | NO   |     | NULL    |                | select,insert,u

pdate,references |         |

| type     | varchar(10) | utf8_general_ci | YES  |     | NULL    |                | select,insert,u

pdate,references |         |

| address  | varchar(50) | utf8_general_ci | YES  |     | NULL    |                | select,insert,u

pdate,references |         |

| tel      | varchar(20) | utf8_general_ci | YES  |     | NULL    |                | select,insert,u

pdate,references |         |

| wages    | int(11)     | NULL            | YES  |     | NULL    |                | select,insert,u

pdate,references |         |

| contents | tinytext    | utf8_general_ci | YES  |     | NULL    |                | select,insert,u

pdate,references |         |

| extra    | text        | utf8_general_ci | YES  |     | NULL    |                | select,insert,u

pdate,references |         |

+----------+-------------+-----------------+------+-----+---------+----------------+----------------

-----------------+---------+

8 rows in set (0.02 sec)

解決字符集通訊設置不匹配的方法:

(修改默認的character_set_client,character_set_connection,character_set_result)

1. 重新編譯mysql和php,mysql加入編譯參數 –default-character-set=utf8

2. PHP程序在查詢數據庫之前,執行mysql_query(”set names utf8;”);

3.修改my.cnf,在[mysqld]中加入init-connect=”set names utf8” (對于超級用戶連接該選項無效)

4. 啟動mysqld 加入參數 –skip-character-set-client-handshake 忽略客戶端字符集。

本文最后更新于 2023-3-16 15:46,某些文章具有時效性,若有錯誤或已失效,請在網站留言或聯系站長:[email protected]
·END·
站長網微信號:w17tui,關注站長、創業、關注互聯網人 - 互聯網創業者營銷服務中心

免責聲明:本站部分文章和圖片均來自用戶投稿和網絡收集,旨在傳播知識,文章和圖片版權歸原作者及原出處所有,僅供學習與參考,請勿用于商業用途,如果損害了您的權利,請聯系我們及時修正或刪除。謝謝!

17站長網微信二維碼

始終以前瞻性的眼光聚焦站長、創業、互聯網等領域,為您提供最新最全的互聯網資訊,幫助站長轉型升級,為互聯網創業者提供更加優質的創業信息和品牌營銷服務,與站長一起進步!讓互聯網創業者不再孤獨!

掃一掃,關注站長網微信

大家都在看

    熱門排行

      最近更新

        返回頂部
        主站蜘蛛池模板: 亚洲色大成网站www久久九九 | 日本G奶乳液汁 | 亚洲精品中文字幕在线 | 琪琪伦伦影院理论片 | 黑人干亚洲人 | 久久99re6热在线播放 | 牛牛在线(正)精品视频 | av天堂影音先锋在线 | 海角国精产品一区一区三区糖心 | 影音先锋色av男人资源网 | 精品一区二区三区四区五区六区 | 欧美人与动牲交XXXXBBBB免费 | 99久久香蕉| 玩弄放荡人妻一区二区三区 | 色偷偷网站 | 亚色九九九全国免费视频 | adc影院欢迎您大驾光临入口 | 韩国羞羞秘密教学子开车漫书 | 国产传媒18精品免费观看 | YELLOW视频直播在线观看 | 日本无码欧美激情在线视频 | 一个人免费完整在线观看影院 | 久爱精品亚洲电影午夜 | 9国产露脸精品国产麻豆 | 青青草在现线免费观看 | 老师紧窄粉嫩 | 无限资源在线观看完整版免费下载 | 国产麻豆福利AV在线观看 | 1300部真实小Y女视频合集 | 99福利影院| 色精品极品国产在线视频 | 欧美人成在线观看ccc36 | 亚洲三级精品 | 香蕉eeww99国产精选播放 | 国产不卡无码高清视频 | 纯肉小黄文高H | 亚洲免费三区 | 美女医生深夜在家裸睡惨死 | 神马影院午夜理论二 | jk制服喷水| 亚洲色欲H网在线观看 |