命令行客户端
- 操作数据库
- 操作数据表
操作数据库
mysql> create database mike charset=utf8;
Query OK, 1 row affected (0.01 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mike |
| mysql |
| performance_schema |
| sys |
| test |
| test_01 |
+--------------------+
7 rows in set (0.00 sec)
mysql> drop database mike;
Query OK, 0 rows affected (0.02 sec)
操作数据表
mysql> use test_01;
Database changed
mysql> desc info01;
+-------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+--------------+------+-----+---------+-------+
| name | varchar(255) | YES | | NULL | |
| age | int(3) | YES | | NULL | |
+-------+--------------+------+-----+---------+-------+
2 rows in set (0.01 sec)
mysql> show create table info01;
+--------+------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+--------+------------------------------------------------------------------------------------------------------------------------------+
| info01 | CREATE TABLE `info01` (
`name` varchar(255) DEFAULT NULL,
`age` int(3) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 |
+--------+------------------------------------------------------------------------------------------------------------------------------+