

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Determine what a MySQL DB’s charset is set to
Let’s say we are creating a database “web” −
mysql> SHOW CREATE DATABASE web;
This will produce the following output displaying the default charset as well −
+----------+-----------------------------------------------------------------------------------------+ | Database | Create Database | +----------+-----------------------------------------------------------------------------------------+ | web | CREATE DATABASE `web` /*!40100 DEFAULT CHARACTER SET utf8 COLLATEutf8_unicode_ci */ | +----------+-----------------------------------------------------------------------------------------+ 1 row in set (0.03 sec)
If you want to know the charset for a particular table from a databse, then use the below query. Here, let’s say we have a table with name DemoTable in the database “web” −
mysql> SHOW CREATE table web.DemoTable;
This will produce the following output displaying the charset −
+--------------+----------------------------------------------------------------------------------------------------------------------------------+ | Table | Create Table | +--------------+----------------------------------------------------------------------------------------------------------------------------------+ | DemoTable | CREATE TABLE `DemoTable` (`Value` int(11) DEFAULT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci | +--------------+----------------------------------------------------------------------------------------------------------------------------------+ 1 row in set (0.00 sec)
- Related Questions & Answers
- Set column charset in MySQL?
- How to change the default charset of a MySQL table?
- HTML Charset
- Java Program to determine a Character's Unicode Block
- How to identify foreign key in MySQL DB?
- HTML charset Attribute
- What are units based on dB?
- What is the Java equivalent to MySQL's smallint?
- HTML accept-charset Attribute
- What is the PHP equivalent of MySQL's UNHEX()?
- How to Connect a DB to pgAdmin in PostgreSQL ?
- Getting details when a table is modified in SAP HANA DB
- What is a set in Java?
- What is S-Box Substitution?
- C++ Program to Find k Numbers Closest to Median of S, Where S is a Set of n Numbers
Advertisements