1. 程式人生 > >mysql8基礎 describe 顯示錶的結構

mysql8基礎 describe 顯示錶的結構

資料,資料,命根就在資料 ! 操作資料庫時,一定要謹慎小心。師萬物 這裡的程式碼看看就好,要有自己的判斷。遇到抉擇,要不恥上下問。

example

stu@Ubuntu:~$ mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 16
Server version: 8.0.12 MySQL Community Server - GPL

Copyright (c) 2000, 2018, Oracle and/or
its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> show databases; +--------------------+
| Database | +--------------------+ | information_schema | | mysql | | performance_schema | | sys | +--------------------+ 4 rows in set (0.00 sec) mysql> use information_schema; Reading table information for completion of table and column names You can turn off
this feature to get a quicker startup with -A Database changed mysql> show tables; +---------------------------------------+ | Tables_in_information_schema | +---------------------------------------+ | CHARACTER_SETS | | COLLATIONS | | COLLATION_CHARACTER_SET_APPLICABILITY | | COLUMNS | | COLUMN_PRIVILEGES | | COLUMN_STATISTICS | | ENGINES | | EVENTS | | FILES | | INNODB_BUFFER_PAGE | | INNODB_BUFFER_PAGE_LRU | | INNODB_BUFFER_POOL_STATS | | INNODB_CACHED_INDEXES | | INNODB_CMP | | INNODB_CMPMEM | | INNODB_CMPMEM_RESET | | INNODB_CMP_PER_INDEX | | INNODB_CMP_PER_INDEX_RESET | | INNODB_CMP_RESET | | INNODB_COLUMNS | | INNODB_DATAFILES | | INNODB_FIELDS | | INNODB_FOREIGN | | INNODB_FOREIGN_COLS | | INNODB_FT_BEING_DELETED | | INNODB_FT_CONFIG | | INNODB_FT_DEFAULT_STOPWORD | | INNODB_FT_DELETED | | INNODB_FT_INDEX_CACHE | | INNODB_FT_INDEX_TABLE | | INNODB_INDEXES | | INNODB_METRICS | | INNODB_TABLES | | INNODB_TABLESPACES | | INNODB_TABLESPACES_BRIEF | | INNODB_TABLESTATS | | INNODB_TEMP_TABLE_INFO | | INNODB_TRX | | INNODB_VIRTUAL | | KEYWORDS | | KEY_COLUMN_USAGE | | OPTIMIZER_TRACE | | PARAMETERS | | PARTITIONS | | PLUGINS | | PROCESSLIST | | PROFILING | | REFERENTIAL_CONSTRAINTS | | RESOURCE_GROUPS | | ROUTINES | | SCHEMATA | | SCHEMA_PRIVILEGES | | STATISTICS | | ST_GEOMETRY_COLUMNS | | ST_SPATIAL_REFERENCE_SYSTEMS | | TABLES | | TABLESPACES | | TABLE_CONSTRAINTS | | TABLE_PRIVILEGES | | TRIGGERS | | USER_PRIVILEGES | | VIEWS | +---------------------------------------+ 62 rows in set (0.00 sec) mysql> describe CHARACTER_SETS; +----------------------+------------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +----------------------+------------------+------+-----+---------+-------+ | CHARACTER_SET_NAME | varchar(64) | NO | | NULL | | | DEFAULT_COLLATE_NAME | varchar(64) | NO | | NULL | | | DESCRIPTION | varchar(2048) | NO | | NULL | | | MAXLEN | int(10) unsigned | NO | | NULL | | +----------------------+------------------+------+-----+---------+-------+ 4 rows in set (0.01 sec) mysql> exit; Bye stu@Ubuntu:~$

resource

MySQL是一個關係型資料庫管理系統,目前是開源的(2018-10)。 許可權明確,恰當選擇引擎與字符集,命名簡潔明瞭與規範。 MariaDB,Redis,MongoDB,PostgreSQL,Hive,HBase等,可以簡單地瞭解。 Workbench,phpMyAdmin,Navicat等圖形化管理工具,可以試用一下。