The show Databases command is used to display all databases.
Show databases command format: show databases; (Note: There is a last s)
For example:mysql> show databases;
Note: To modify the default encoding of the database in order not to be garbled at the time of display. The following is an example of the GBK encoding page.
1) Modify the MySQL configuration file: My.ini inside Modify DEFAULT-CHARACTER-SET=GBK
2) Code Runtime Modification:
- Java code: JDBC:MYSQL://LOCALHOST:3306/TEST?USEUNICODE=TRUE&CHARACTERENCODING=GBK
- PHP Code: Header ("content-type:text/html;charset=gb2312");
- C language code: int mysql_set_character_set (mysql * mysql, char * csname);
This function is used to set the default character set for the current connection. The string csname specifies 1 valid character set names. Connection proofing becomes the default proofing for character sets. This function works similarly to the set names statement, but it also sets the value of mysql-> CharSet, which affects the character sets set by the Mysql_real_escape_string ().
Notes mysql command show databases: Show all databases