MySQL database learning-2. database selection, creation, deletion, and change

Source: Internet
Author: User
Select a database. After the database is selected, you can still use the data tables in other databases. You only need to specify database. data table.

Use db_name

Select * From db_name.tbl_name Show all databases Mysql> select Schema_name from orders; + -------------------- + | Schema_name | + ------------------ + | information_schema | Feng | MySQL | + ------------------------ + 3 rows in SET (0.11 Sec) Display tables of the database Feng Mysql> select table_name from information_schema.tables where table_schema = 'feng'; + ------------ + | table_name | + ------------ + | Feng | + ------------ + 1 row in SET (0.05 Sec) Database creation Create Database db_namecreate database db_name if not exists db_namecreate database db_name If not exists db_name Character Set utf8 Collate utf8_icelandic_ci Show create database db_name \ G Delete Database Drop database db_nameddrop database db_name if not exists db_name Database Modification Alter database db_name default Character Set utf8 default collate utf8_general_ci
Related Article

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.