Data types in MySQL:
Integer type:
#查看int整数型的帮助.
Mysql>? Intname: ' INT ' description:int[(M)] [UNSIGNED] [zerofill]a normal-size Integer. The signed range is-2147483648 to 2147483647.The unsigned range are 0 to 4294967295.URL:HTTP://DEV.MYSQL.COM/DOC/REFMAN/5 .6/en/numeric-type-overview.html
#查看创建数据库的帮助, this discovery is not recognized using schema.
mysql> help create Schemanothing foundplease try-to-run ' help Contents ' for a list of all accessible topics
#可以使用help? \h three options to see Help.
mysql> help create DatabaseName: ' Create database ' Description:Syntax:CREATE {database | SCHEMA} [IF not EXISTS] db_name [create_specification] ... create_specification: [DEFAULT] CHARACTER SET [=] charset_ name | [DEFAULT] COLLATE [=] collation_namecreate database creates a database with the given name. To use thisstatement, you need the CREATE privilege for the database. Createschema is a synonym for CREATE DATABASE. Url:http://dev.mysql.com/doc/refman/5.6/en/create-database.html
Mysql>? Tinyintname: ' TINYINT ' description:tinyint[(M)] [UNSIGNED] [zerofill]a very small integer. The signed range is-128 to 127. The Unsignedrange is 0 to 255.url:http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html
mysql> \h intname: ' INT ' description:int[(M)] [UNSIGNED] [zerofill]a normal-size Integer. The signed range is-2147483648 to 2147483647.The unsigned range are 0 to 4294967295.URL:HTTP://DEV.MYSQL.COM/DOC/REFMAN/5 .6/en/numeric-type-overview.html
Floating-point types:
M is the total number of digits, and D is the number of digits after the decimal point.
Float (m,d)
String type:
Char (m) m bytes, 0-255
varchar (M) l+1 bytes, 0-65535
Date Time Type:
Time
Date
Datetime
Year
#查看mysql有那些存储引擎 (default is InnoDB)
mysql> show engines;+--------------------+---------+--------------------------------------------- -------------------+--------------+------+------------+| engine | Support | Comment | transactions | xa | savepoints |+--------------------+---------+---------------------------- ------------------------------------+--------------+------+------------+| memory | yes | hash based, stored in memory, useful for temporary tables | no | no | no | | csv | YES | CSV storage engine | NO | NO | no | | MRG_MYISAM | YES | Collection of identical MyISAM tables | no | no | no | | BLACKHOLE | YES | /dev/null storage engine (anything you write to it Disappears) | NO | NO | no | | MyISAM | YES | MyISAM storage engine | no | NO | NO | | FEDERATED | NO | Federated MySQL storage engine | NULL | null | null | | ARCHIVE | YES | archive storage engine | NO | NO | NO | | InnoDB | DEFAULT | supports transactions, row-level locking, and foreign keys | YES | YES | yes | | PERFORMANCE_SCHEMA | YES | Performance Schema | no | no | no |+--------------------+---------+----------------------------- -----------------------------------+--------------+------+------------+9 rows in set (0.00  SEC)
#查看显示支持的存储引擎的信息:
mysql> show variables like ' have% '; +----------------------+----------+| variable_ name | value |+-------------------- --+----------+| have_compress | yes | | have_crypt | YES | | have_dynamic_loading | yes | | have_geometry | YES | | have_openssl | disabled | | have_profiling | yes | | have_query_cache | yes | | have_rtree_keys | yes | | have_ssl | disabled | | have_symlink | disabled |+--------------- -------+----------+10 rows in set (0.00 sec)
This article is from the "LINUX Super Dream" blog, make sure to keep this source http://215687833.blog.51cto.com/6724358/1905770
MySQL data type