What is the query to check the character set of a MySQL table column?

WBOY
Release: 2023-09-22 08:05:28
forward
643 people have browsed it

What is the query to check the character set of a MySQL table column?

The following is a query to check the character set of a MySQL table column -

mysql> Select Column_name 'Column', Character_set_name 'Charset' FROM information_schema.columns where table_schema = 'db_name' and table_name ='table_name';
Copy after login

Example

For example, the following query returns a query named "sample" The column names of the "test_char_set" table in the database and the character sets for these columns.

mysql> Select Column_name 'Column', Character_set_name 'Charset' FROM information_schema.columns where table_schema = 'Sample' and table_name ='test_char_set'; +--------+---------+ | Column | Charset | +--------+---------+ | Name | latin1 | | Field | latin1 | +--------+---------+ 2 rows in set (0.03 sec)
Copy after login

The above is the detailed content of What is the query to check the character set of a MySQL table column?. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!