Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find out the charset of a database and table with PHPmyAdmin?

Tags:

phpmyadmin

Is there a way in PHPMyAdmin to find out the charset of a table and/or a database?

The only thing that ist shown, is the collation. But as far as I understood, the collation only tells the database how to compare the data, and the charset tells the database how to store the data.

like image 349
R_User Avatar asked Aug 01 '12 11:08

R_User


People also ask

How do I find the charset of a database?

To see the default character set and collation for a given database, use these statements: USE db_name; SELECT @@character_set_database, @@collation_database; Alternatively, to display the values without changing the default database: SELECT DEFAULT_CHARACTER_SET_NAME, DEFAULT_COLLATION_NAME FROM INFORMATION_SCHEMA.

How do I find the character set of a SQL Server database?

You can get an idea of what character sets are used for the columns in a database as well as the collations using this SQL: select data_type, character_set_catalog, character_set_schema, character_set_name, collation_catalog, collation_schema, collation_name, count(*) count from information_schema.


2 Answers

Try writing a SQL command:

SELECT * FROM information_schema.SCHEMATA S
WHERE schema_name = "myDataBase";

You might want to check this answer and the comments on this ressoure;

like image 104
George D Avatar answered Oct 21 '22 04:10

George D


Alternatively, you can also find it by just looking at the collation name itself in most of the cases. Say the collation name is "latin1_swedish_ci" then the character set for the database is "latin1".

like image 25
Praym Avatar answered Oct 21 '22 04:10

Praym