Home >Database >Mysql Tutorial >Example analysis of common MySQL commands

Example analysis of common MySQL commands

王林
王林forward
2023-05-26 19:49:041562browse

1. View all current databases

show databases;

2. Open the specified library use library name

3. View all tables of the current library

show tables;

4. View All tables in other libraries

show tables from 库名;

5. Create table

create table 表名(  
列名 列类型,    
列名 列类型,    
。。。
);

6. View table structure

desc 表名;

7. View server version

Method 1: Log in to the mysql server select version();

Method 2: Not logged in to the mysql server mysql --version or mysql --V

The above is the detailed content of Example analysis of common MySQL commands. For more information, please follow other related articles on the PHP Chinese website!

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