- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
MySQL query to discover current default database collation (via command line client)?
You need to use INFORMATION_SCHEMA.SCHEMATA for current default database collation.
The syntax is as follows
SELECT DEFAULT_COLLATION_NAME FROM information_schema.SCHEMATA WHERE SCHEMA_NAME = 'yourDatabaseName' LIMIT 1;
Let us implement the above syntax to discover current default database collation (via command line client). Our database here is ‘sample’.
The query is as follows −
mysql> SELECT DEFAULT_COLLATION_NAME FROM information_schema.SCHEMATA WHERE SCHEMA_NAME = 'sample' LIMIT 1;
The following is the output
+------------------------+ | DEFAULT_COLLATION_NAME | +------------------------+ | utf8_general_ci | +------------------------+ 1 row in set (0.00 sec)
- The MySQL Command-Line Client
- MySQL command line client for Windows?
- Connect to MySQL database from command line
- Connecting to MySQL database from the command line?
- Interactive plotting with Python Matplotlib via command line
- How to create a database on command line in MySQL?
- Show MySQL host via SQL Command?
- How to see spaces in data when selecting with MySQL command line client?
- How to convert an MySQL database characterset and collation to UTF-8?
- Rainbow Stream – An Advanced Command-line Twitter Client for Linux
- How to change collation to utf8_bin in a single line?
- How to open MySQL command line on Windows10?
- How to upgrade MySQL server from command line?
- MySQL command for display current configuration variables?
- MySQL command for displaying current configuration variables?