3. Display all tables in the database show"/> 3. Display all tables in the database show">

Home  >  Article  >  System Tutorial  >  Detailed method of using MySQL in Linux environment

Detailed method of using MySQL in Linux environment

王林
王林forward
2024-01-12 21:51:141134browse

The article is based on the UI part of the system designed using the django framework using Python. There are some places where mysql is used. MySQL is not commonly used in this case, so some simple usage records are recorded here to prevent forgetting

0. Enter mysql

First start mysql, note "mysqld"

systemctl start mysqld

Then enter:

mysql -u root -p

Then enter the password.

1. View all databases

show databases;

For example, I checked all databases:

Detailed method of using MySQL in Linux environment

2. Use database

use  <database-name>

Detailed method of using MySQL in Linux environment

3. Display all tables in the database

show tables

Detailed method of using MySQL in Linux environment

4. Display data table structure

describe  <table-name>

Detailed method of using MySQL in Linux environment

5. Delete database

drop <database-name>

6. Delete table

drop <table-name>
<font face="Tahoma"><span style="white-space: normal;"> </span></font>

The above is the detailed content of Detailed method of using MySQL in Linux environment. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:jb51.net. If there is any infringement, please contact admin@php.cn delete