Field Type
1. INT [(M)]
Normal size Integer type
2. DOUBLE [(M, D)] [ZEROFILL]
Normal size (Double Precision) floating point numeric type
3. DATE
Date type. The supported range is '2017-01-01 'to '2017-12-31 '. MySQL displays the DATE value in 'yyyy-MM-DD 'format, but allows you to assign the value to the DATE column using strings or numbers
4. CHAR (M)
Fixed-length string type. When stored, it always fills the Right to the specified length with spaces
5. BLOB TEXT
BLOB or TEXT type. The maximum length is 65535 (2 ^ 16-1) characters.
6. VARCHAR
Variable-length string type.
1: display the database
Show databas,
2: currently selected database,
Mysql> select database ();
------------
| DATABASE () |
------------
| Test;
------------
| DATABASE () |
------------
| Test |
------------
Table information contained in the current database:
Mysql> show tables;
---------------------
| Tables in test
Mysql> show tables;
---------------------
| Tables in test |
---------------------
| Mytable1 |
| Mytable2 |
---------------------
Get table structure
Mysql> desc mytable1;
-------------------------------------------------
| Field mysql> desc mytable1;
-------------------------------------------------
| Field | Type | Null | Key | Default | Extra |
-------------------------------------------------
| S1 | varchar (20) | YES | NULL |
------------------------------------------------
5. Import database tables
(1) create a. SQL File
(2) first generate a database such as auction. c: mysqlbin> mysqladmin-u root-p creat auction. A prompt is displayed, indicating that the password is entered and created successfully.
(2) import the auction. SQL File