Home > Operation and Maintenance > Linux Operation and Maintenance > How to view the database in linux

How to view the database in linux

王林
Release: 2019-12-25 10:18:27
Original
12724 people have browsed it

How to view the database in linux

First enter the following command:

mysql -uroot -p
Copy after login

Enter the root password to enter mysql.

Specific viewing steps:

Free online video tutorial recommendation: linux video tutorial

1. Display database

show databases;
Copy after login

2. Select the database

use 数据库名;
Copy after login

3. Display the tables in the database

show tables;
Copy after login

4. Display the structure of the data table

describe 表名;
Copy after login

5. Display the records in the table

SELECT * FROM 表名
Copy after login

6. Database building

create databse 库名;
Copy after login

Recommended related articles and tutorials: linux tutorial

The above is the detailed content of How to view the database in linux. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
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