MySQL command (a): database-related operational command

First, view information database

1, check the database version

Command: select @@ version;

example:

2, view the database state information

Command: status;

example:


3, view the current database connections

命令:show status like 'threads_connected';

example:

4, see the maximum number of current connections

命令:show variables like 'max_connections';

example:

5, view the default encoding information

命令:show variables like '%char%';

example:

6, view all existing database

Command: show databases;

example:

7, see coding information on a database

Command: show create database database name;

example:

8. Check the timeout, the delay time

命令:show variables like '%timeout%';

example:

9. Check the cache case

Command: show status like '% cache%';

example:

https://www.xiaohongshu.com/discovery/item/5d74966e000000000201cf74

10, view the log start case

命令:show variables like 'log_%';

example:

Zhengzhou infertility hospital: http: //jbk.39.net/yiyuanzaixian/zztjyy/

 

Second, create a database

1. Create a database

Command: create database database name;

example:


 

Third, delete the database

1, delete a database

Command: drop database database name;

example:

 

Fourth, modify the database

1, a database of a modified encoding

Command: alter database name of the database character set gbk

example:

 

Fifth, select the database

1, select a database

Commands: use database name;

example:


Guess you like

Origin blog.51cto.com/14510269/2437730