Notes mysql command show databases: Show all databases

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.