mysql字符集查询与设置方法_MySQL
bitsCN.com 说到底mysql 乱码的根源是的 mysql 字符集设置不当的问题。
有关查看 mysql 字符集的命令。
包括查看 mysql 数据库服务器字符集、查看 mysql 数据库字符集,以及数据表和字段的字符集、当前安装的 mysql 所支持的字符集等。
一、查看 mysql 数据库服务器和数据库字符集。
- mysql> show variables like '%char%';
- +--------------------------+-------------------------------------+------
- | variable_name | value |......
- +--------------------------+-------------------------------------+------
- | character_set_client | utf8 |...... -- 客户端字符集
- | character_set_connection | utf8 |......
- | character_set_database | utf8 |...... -- 数据库字符集
- | character_set_filesystem | binary |......
- | character_set_results | utf8 |...... www.jbxue.com
- | character_set_server | utf8 |...... -- 服务器字符集
- | character_set_system | utf8 |......
- | character_sets_dir | d:/mysql server 5.0/share/charsets/ |......
- +--------------------------+-------------------------------------+------
二、查看 mysql 数据表(table) 的字符集。
- mysql> show table status from sqlstudy_db like '%countries%';
- +-----------+--------+---------+------------+------+-----------------+------
- | name | engine | version | row_format | rows | collation |......
- +-----------+--------+---------+------------+------+-----------------+------
- | countries | innodb | 10 | compact | 11 | utf8_general_ci |......
- +-----------+--------+---------+------------+------+-----------------+------
三、查看 mysql 数据列(column)的字符集。
- mysql> show full columns from countries;
- +----------------------+-------------+-----------------+--------
- | field | type | collation | .......
- +----------------------+-------------+-----------------+--------
- | countries_id | int(11) | null | .......
- | countries_name | varchar(64) | utf8_general_ci | .......
- | countries_iso_code_2 | char(2) | utf8_general_ci | .......
- | countries_iso_code_3 | char(3) | utf8_general_ci | .......
- | address_format_id | int(11) | null | .......
- +----------------------+-------------+-----------------+--------
- mysql字符集查看与设置详解
- Mysql字符集设置详解
- 有关mysql字符集设定的知识总结
- (图文)mysql字符集设置详解
四、查看当前安装的 mysql 所支持的字符集。- mysql> show charset;
- mysql> show char set;
- +----------+-----------------------------+---------------------+--------+
- | charset | description | default collation | maxlen |
- +----------+-----------------------------+---------------------+--------+
- | big5 | big5 traditional chinese | big5_chinese_ci | 2 |
- | dec8 | dec west european | dec8_swedish_ci | 1 |
- | cp850 | dos west european | cp850_general_ci | 1 |
- | hp8 | hp west european | hp8_english_ci | 1 |
- | koi8r | koi8-r relcom russian | koi8r_general_ci | 1 |
- | latin1 | cp1252 west european | latin1_swedish_ci | 1 |
- | latin2 | iso 8859-2 central european | latin2_general_ci | 1 |
- | swe7 | 7bit swedish | swe7_swedish_ci | 1 |
- | ascii | us ascii | ascii_general_ci | 1 |
- | ujis | euc-jp japanese | ujis_japanese_ci | 3 |
- | sjis | shift-jis japanese | sjis_japanese_ci | 2 |
- | hebrew | iso 8859-8 hebrew | hebrew_general_ci | 1 |
- | tis620 | tis620 thai | tis620_thai_ci | 1 |
- | euckr | euc-kr korean | euckr_korean_ci | 2 |
- | koi8u | koi8-u ukrainian | koi8u_general_ci | 1 |
- | gb2312 | gb2312 simplified chinese | gb2312_chinese_ci | 2 |
- | greek | iso 8859-7 greek | greek_general_ci | 1 |
- | cp1250 | windows central european | cp1250_general_ci | 1 |
- | gbk | gbk simplified chinese | gbk_chinese_ci | 2 |
- | latin5 | iso 8859-9 turkish | latin5_turkish_ci | 1 |
- | armscii8 | armscii-8 armenian | armscii8_general_ci | 1 |
- | utf8 | utf-8 unicode | utf8_general_ci | 3 |
- | ucs2 | ucs-2 unicode | ucs2_general_ci | 2 |
- | cp866 | dos russian | cp866_general_ci | 1 |
- | keybcs2 | dos kamenicky czech-slovak | keybcs2_general_ci | 1 |
- | macce | mac central european | macce_general_ci | 1 |
- | macroman | mac west european | macroman_general_ci | 1 |
- | cp852 | dos central european | cp852_general_ci | 1 |
- | latin7 | iso 8859-13 baltic | latin7_general_ci | 1 |
- | cp1251 | windows cyrillic | cp1251_general_ci | 1 |
- | cp1256 | windows arabic | cp1256_general_ci | 1 |
- | cp1257 | windows baltic | cp1257_general_ci | 1 |
- | binary | binary pseudo charset | binary | 1 |
- | geostd8 | geostd8 georgian | geostd8_general_ci | 1 |
- | cp932 | sjis for windows japanese | cp932_japanese_ci | 2 |
- | eucjpms | ujis for windows japanese | eucjpms_japanese_ci | 3 |
- +----------+-----------------------------+---------------------+--------+

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Go language is an efficient, concise and easy-to-learn programming language. It is favored by developers because of its advantages in concurrent programming and network programming. In actual development, database operations are an indispensable part. This article will introduce how to use Go language to implement database addition, deletion, modification and query operations. In Go language, we usually use third-party libraries to operate databases, such as commonly used sql packages, gorm, etc. Here we take the sql package as an example to introduce how to implement the addition, deletion, modification and query operations of the database. Assume we are using a MySQL database.

Apple's latest releases of iOS18, iPadOS18 and macOS Sequoia systems have added an important feature to the Photos application, designed to help users easily recover photos and videos lost or damaged due to various reasons. The new feature introduces an album called "Recovered" in the Tools section of the Photos app that will automatically appear when a user has pictures or videos on their device that are not part of their photo library. The emergence of the "Recovered" album provides a solution for photos and videos lost due to database corruption, the camera application not saving to the photo library correctly, or a third-party application managing the photo library. Users only need a few simple steps

Hibernate polymorphic mapping can map inherited classes to the database and provides the following mapping types: joined-subclass: Create a separate table for the subclass, including all columns of the parent class. table-per-class: Create a separate table for subclasses, containing only subclass-specific columns. union-subclass: similar to joined-subclass, but the parent class table unions all subclass columns.

How to install PHPFFmpeg extension on server? Installing the PHPFFmpeg extension on the server can help us process audio and video files in PHP projects and implement functions such as encoding, decoding, editing, and processing of audio and video files. This article will introduce how to install the PHPFFmpeg extension on the server, as well as specific code examples. First, we need to ensure that PHP and FFmpeg are installed on the server. If FFmpeg is not installed, you can follow the steps below to install FFmpe

How to use MySQLi to establish a database connection in PHP: Include MySQLi extension (require_once) Create connection function (functionconnect_to_db) Call connection function ($conn=connect_to_db()) Execute query ($result=$conn->query()) Close connection ( $conn->close())

To handle database connection errors in PHP, you can use the following steps: Use mysqli_connect_errno() to obtain the error code. Use mysqli_connect_error() to get the error message. By capturing and logging these error messages, database connection issues can be easily identified and resolved, ensuring the smooth running of your application.

HTML cannot read the database directly, but it can be achieved through JavaScript and AJAX. The steps include establishing a database connection, sending a query, processing the response, and updating the page. This article provides a practical example of using JavaScript, AJAX and PHP to read data from a MySQL database, showing how to dynamically display query results in an HTML page. This example uses XMLHttpRequest to establish a database connection, send a query and process the response, thereby filling data into page elements and realizing the function of HTML reading the database.

According to news from this website on July 23, ASUS has launched a variety of server and workstation-level products powered by AMD EPYC 4004 series processors. Note from this site: AMD launched the AM5 platform and Zen4 architecture EPYC 4004 series processors in May, offering up to 16-core 3DV-Cache specifications. ASUSProER100AB6 server ASUSProER100AB6 is a 1U rack server product equipped with EPYC Xiaolong 4004 series processor, suitable for the needs of IDC and small and medium-sized enterprises. ASUSExpertCenterProET500AB6 workstation ASUSExpertCenterProET500AB6 is a
