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
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.