
- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
How can we check the character set of all the tables in a particular MySQL database?
With the help of the following MySQL query we can check the character sets of all the tables in a particular database −
mysql> Select TABLE_NAME, CHARACTER_SET_NAME FROM INFORMATION_SCHEMA.Columns Where TABLE_SCHEMA = 'db_name';
Example
For example, the query below returns the character sets of all the tables in a database named ‘Alpha’.
mysql> Select TABLE_NAME, CHARACTER_SET_NAME FROM INFORMATION_SCHEMA.Columns Where TABLE_SCHEMA = 'Alpha'; +------------+--------------------+ | TABLE_NAME | CHARACTER_SET_NAME | +------------+--------------------+ | employee | latin1 | | employee | latin1 | | student | latin1 | | student | NULL | | student | latin1 | +------------+--------------------+ 5 rows in set (0.06 sec)
The output shows 5 rows, 2 for employee table and 3 for student table because table employee contains two columns and table student contains three columns.
- Related Articles
- How can I check the character set of all the tables along with column names in a particular MySQL database?
- How can we check the default character sets of a particular MySQL database?
- How Can I check the size of the tables in a particular MySQL database?
- How can we analyze the tables of a particular database from MySQL Server command line?
- How to check table status of the tables in a particular MySQL database?
- How can we get the list of tables in a particular database from MySQL Server command line?
- How can I check MySQL tables from a database in accordance with particular\ncolumn/s name?
- In MySQL, how can we get the number code of a particular character?
- How can we check the list of all triggers in a database?
- How can I check the list of MySQL tables, in the current database we are using, along with table type in the result set?
- How can we see the list of views stored in a particular MySQL database?
- How can we check the default character sets of all the MySQL databases we have on the server?
- How can I check the list of MySQL tables, in a different database than we are using currently, along with table type in the result set?
- How can we see only the list of stored procedures in a particular MySQL database?
- How can we see only the list of stored functions in a particular MySQL database?

Advertisements