Home > System Tutorial > LINUX > body text

Detailed method of using MySQL in Linux environment

王林
Release: 2024-01-12 21:51:14
forward
1149 people have browsed it

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

Copy after login

Then enter:

mysql -u root -p

Copy after login

Then enter the password.

1. View all databases

show databases;

Copy after login

For example, I checked all databases:

Detailed method of using MySQL in Linux environment

2. Use database

use  <database-name>

Copy after login

Detailed method of using MySQL in Linux environment

3. Display all tables in the database

show tables

Copy after login

Detailed method of using MySQL in Linux environment

4. Display data table structure

describe  <table-name>

Copy after login

Detailed method of using MySQL in Linux environment

5. Delete database

drop <database-name>

Copy after login

6. Delete table

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

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!

source:jb51.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template