Mysql common sense and basic operations_PHP tutorial

WBOY
Release: 2016-07-13 17:02:12
Original
746 people have browsed it

Field type
  1. INT[(M)]
  Normal size integer type
  2. DOUBLE[(M,D)] [ZEROFILL]
Normal size (double precision) floating point number type
3. DATE
  Date type. The supported range is '1000-01-01' to '9999-12-31'. MySQL displays DATE values ​​in 'YYYY-MM-DD' format, but allows you to use strings or numbers to assign values ​​to DATE columns
  4. CHAR(M)
  Fixed-length string type, when stored, always fills the right side with spaces to the specified length
  5. BLOB TEXT
  BLOB or TEXT type, the maximum length is 65535 (2^16-1) characters.
 6. VARCHAR
  Variable length string type.

1: Show database

SHOW DATABAS,
2: Currently selected database,
mysql> SELECT DATABASE();
-------- ----
  | DATABASE() |
  ------------
  | test ;
  ------------
| DATABASE() |
  ------------
  | test   |
  --------------------------
  Tables contained in the current database Information:
mysql> SHOW TABLES;
--------------------------
| Tables in test
mysql> SHOW TABLES;
  --------------------------
  | Tables in test |
  ---------------- -----
  | mytable1   | mysql> desc mytable1;
  --------- ------------- ------ ----- --------- -------
| Field mysql> desc mytable1;
--------- ------------- ------ -- --- --------- -------
| Field | Type | Null | Key | Default | Extra |
--------- --- ---------- ------ ----- --------- -------
  | s1 | varchar(20) | YES | NULL |
--------------------- ------ ----- --------- --- ----
5. Import database table
(1) Create a .sql file
(2) First generate a library such as auction.c:mysqlbin>mysqladmin -u root -p creat auction, you will be prompted Enter the password and create successfully.
  (2) Import the auction.sql file




http://www.bkjia.com/PHPjc/631076.html

www.bkjia.com

http: //www.bkjia.com/PHPjc/631076.htmlTechArticleField type 1. INT[(M)] normal size integer type 2. DOUBLE[(M,D)] [ZEROFILL] Normal size (double precision) floating point number type 3. DATE date type. The supported range is '1000-01-01' to '9...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template