View the full analysis of the MySQL database from the command line

Press on any interface of the computer: windows key + R key
, the "Run" window will pop up
insert image description here
, enter: cmd in the text box, click OK,
insert image description here
a black window will pop up , and
insert image description here
enter the command line.

mysql -uroot -p123456

inrootis the account of the local database,123456is the password for the local database

After pressing the Enter key, the following picture will be displayed:
insert image description here
Enter:

show databases;

It can display all the databases of the computer.
Ps: Note that there is a semicolon, which is still in English.
insert image description here
At this point you can pick and choose which database to use.

use histmap;

indicate that I want to usehistmapthis database.
If it showsDatabase changedIndicates successful use.
Enter again:

show tables;

All tables in this database can be viewed.
insert image description here
To further view the structure of the table, you can enter:

desc link;

Indicates that I want to querylinkTable structure
insert image description here
If you want to query table information, you can enter:

select * from link;

Indicates that I want to querylinkAll information in the table.
insert image description here
The rest belongs to the category of SQL statements, and will be updated later if necessary.

In addition to the SQL statement, please leave a message to let me know if there is anything lacking in this article, and I will continue to improve it.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325932608&siteId=291194637