- View database->show databases;
- Build database->create database name;
- Build table->use database name;->create table name (field);
- View all tables->show tables;
- View table information->desc table name;
- Delete table->drop database name;
1 mysql> show databases;2 +--------------------+3 | Database |4 +--------------------+5 | information_schema |6 | mysql |7 | test |8 +--------------------+9 3 rows in Set (0.02 sec)Ten One mysql> Create database addr; A Query OK, 1 row Affected (0.00 sec) - - mysql> show databases; the +--------------------+ - | Database | - +--------------------+ - | information_schema | + | addr | - | mysql | + | test | A +--------------------+ at 4 rows in Set (0.00 sec) - - mysql> use addr; - Database changed - mysql> show tables; - Empty Set (0.02 sec) in - mysql> CREATE TABLE address ( to -ID int primary key auto_increment, + (), name varchar, - -street varchar, the City varchar, * , State varchar (), $ zip varchar (6)Panax Notoginseng ); - Query OK, 0 rows affected (0.19 sec) the + mysql> show tables; A +----------------+ the | tables_in_addr | + +----------------+ - | address | $ +----------------+ $ 1 row in Set (0.00 sec) - - mysql> desc address; the +--------+-------------+------+-----+---------+----------------+ - | Field | Type | Null | Key | Default | Extra |Wuyi +--------+-------------+------+-----+---------+----------------+ the | id | int (11) | NO | PRI | NULL | auto_increment | - | name | varchar (20) | YES | | NULL | | Wu | street | varchar (20) | YES | | NULL | | - | city | varchar (20) | YES | | NULL | | About | state | varchar (20) | YES | | NULL | | $ | zip | varchar (6) | YES | | NULL | | - +--------+-------------+------+-----+---------+----------------+ - 6 rows in Set (0.02 sec) - A mysql> INSERT INTO address (Name,street,city,state,zip) VALUES (' 111 ', ' 111 ', ' 111 ' + , ' 111 ', ' 111 '); the Query OK, 1 row affected (0.09 sec) - $ mysql> INSERT INTO address (Name,street,city,state,zip) VALUES (' 222 ', ' 222 ', ' 111 ' the , ' 111 ', ' 111 '); the Query OK, 1 row affected (0.05 sec) the the mysql> INSERT INTO address (Name,street,city,state,zip) VALUES (' 333 ', ' 333 ', ' 111 ' - , ' 111 ', ' 111 '); in Query OK, 1 row affected (0.05 sec) the the mysql> SELECT * From address; About +----+------+--------+------+-------+------+ the | id | name | street | city | state | zip | the +----+------+--------+------+-------+------+ the | 1 | 111 | 111 | 111 | 111 | 111 | + | 2 | 222 | 222 | 111 | 111 | 111 | - | 3 | 333 | 333 | 111 | 111 | 111 | the +----+------+--------+------+-------+------+Bayi 3 rows in Set (0.00 sec) the theMysql>
"Mysql" command line