Town Yard text:
The Confucian School of the practical and practical, line Buddhism Purdue sentient beings, the monastic Kangsheng fidelity, understanding of the easy to change the image. To science and technology to shine a good law, the achievement of a conscience blog.
______________________________________________________________________________________________________
Operating System:ubuntukylin 16.04 LTS 64bit
Mysql:ver 14.14 Distrib 5.7.17, for Linux (x86_64) using Editline Wrapper
Login:
Show all databases:
Enter the specified database:
[email protected]:~$ mysql -u root -penter password: welcome to The mysql monitor. commands end with ; or \g.your mysql connection id is 12Server version: 5.7.17-0ubuntu0.16.04.1 (Ubuntu) copyright (c) 2000, 2016, Oracle and/or its affiliates. All Rights reserved. oracle is a registered trademark of oracle corporation and/or Itsaffiliates. other names may be trademarks of their respectiveowners . type ' help; ' or ' \h ' for help. Type ' \c ' to clear the current input statement.mysql> show databases -> ;+--------------------+| database |+--------------------+| information_schema | | myfirstdb | | mysql | | performance_schema | | phpmyadmin | | sys |+--- -----------------+6 rows in set (0.00 sec) mysql> use myfirstdbreading table information for completion of table and column namesyou can turn off this feature to get a quicker startup With -adatabase changed
Show all tables under the current database:
Mysql> Show tables;+---------------------+| Tables_in_myfirstdb |+---------------------+| firsttable | | Personalinformation |+---------------------+2 rows in Set (0.00 sec)
To view the structure of a table:
Code
Mysql> describe personalinformation;
Result Show:
+-------+-------------+------+-----+---------+-------+| Field | Type | Null | Key | Default | Extra |+-------+-------------+------+-----+---------+-------+| Nid | Int (11) | YES | UNI | NULL | || name | varchar (20) | YES | | NULL | |+-------+-------------+------+-----+---------+-------+2 rows in Set (0.00 sec)
View the details of a table using what engine:
Code
Mysql> Show CREATE TABLE personalinformation;
Result
+---------------------+---------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------+| table | Create Table |+---------------------+-------------------------------------------- --------------------------------------------------------------------------------------------------------------- --------------+| personalinformation | create table ' personalinformation ' ( ' nid ' int (one) DEFAULT NULL, ' name ' varchar DEFAULT null, unique key ' nid ' (' nid ') engine=innodb default charset=latin1 |+---------------------+--------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------+1 row in set (0.00 Sec
Exit:
Mysql> Exitbye[email protected]:~$
______________________________________________________________________________________________________
If you think this blog post has a place to improve, please comment, I will think carefully.
Note: This blog post is only used for scientific research, if the infringement of your interests, please inform me, I will make the appropriate treatment.
This article is from the "calm mind like water, chi just like the pan." Blog, be sure to keep this source http://xinjingzhigang.blog.51cto.com/12262830/1904227
mysql5.7 Basics View the structure and details of a table what engine is used