4 Database Management (last chapter)
4.1 querying all databases
mysql> show databases; +--------------------+ | Database | +--------------------+ | Information_schema | --MySQL metadata, basic data | MySQL | --mysql The configuration database, which contains user information. (User name and password, rights Management) | Performance_schema | --mysql Database software operation data, log information, performance data | Test | -- test the database. The Empty +--------------------+ 4 rows in Set (0.00 sec) |
4.2 Creating a database
Mysql> CREATE Database Day15-- Specify the default character set for creating databases --Default character set UTF8 ; Query OK, 1 row Affected (0.00 sec) |
4.3 Viewing the default character set for a database
Mysql> Show CREATE Database day15; +----------+----------------------------------------------------------------+ | Database | Create Database | +----------+----------------------------------------------------------------+ | DAY15 | CREATE DATABASE ' day15 '/*!40100 DEFAULT CHARACTER SET UTF8 */| | +----------+----------------------------------------------------------------+ 1 row in Set (0.00 sec) |
4.4 Deleting a database
mysql> drop Database day15; Query OK, 0 rows affected (0.01 sec) |
4.5 Modifying a database
mysql> ALTER DATABASE DAY15 default character set GBK; Query OK, 1 row Affected (0.00 sec) |
Database Basics 3 (MySQL syntax)