Simple example of mysql show operation

  • 2021-11-30 01:51:13
  • OfStack

This article illustrates the mysql show operation. Share it for your reference, as follows:

SHOW CHARACTER SET

Displays all available character sets


SHOW CHARACTER SET;
SHOW CHARACTER SET LIKE 'latin%';

SHOW COLLATION

Output includes all available character sets


SHOW COLLATION;
SHOW COLLATION LIKE 'latin1%';

SHOW COLUMNS

The information of each column displayed in a given table, and this statement also works for views.


SHOW COLUMNS FROM mydb.mytable;
SHOW COLUMNS FROM mytable FROM mydb;

SHOW CREATE DATABASE

Displays the method used to create a given database CREATE DATABASE Statement. You can also use the SHOW CREATE SCHEMA .


SHOW CREATE DATABASE test;
SHOW CREATE DATABASE test\G;

SHOW CREATE TABLE

Shows the sql statement for creating a table


SHOW CREATE TABLE java;
SHOW CREATE TABLE java\G;

SHOW DATABASES

SHOW DATABASES can enumerate databases on the MySQL server host. You can also use the mysqlshow Command to get this list. You can only see databases for which you have certain permissions unless you have global SHOW DATABASES Permission.


SHOW DATABASES;

SHOW ENGINE

SHOW ENGINE displays log or status information for the storage engine. The following statements are currently supported:


SHOW ENGINE BDB LOGS;
SHOW ENGINE INNODB STATUS;

SHOW ENGINES

SHOW ENGINES displays the status information of the storage engine. This statement is useful for checking whether a storage engine is supported, or for seeing what the default engine is.


SHOW ENGINES;
SHOW ENGINES\G;

SHOW ERRORS

This statement displays errors only, not errors, warnings, and attention at the same time.


SHOW COUNT(*) ERRORS;
SHOW ERRORS;

SHOW GRANTS

View related permissions


SHOW GRANTS FOR user;
SHOW GRANTS FOR CURRENT_USER;
SHOW GRANTS FOR CURRENT_USER();

SHOW INDEX

SHOW INDEX returns table index information.


SHOW COLLATION;
SHOW COLLATION LIKE 'latin1%';

0

SHOW INNODB STATUS (mysql5.6 will report an error)

View server information and locate problems

This is SHOW ENGINE INNODB STATUS Synonyms of, but disapprove of the use.

SHOW OPEN TABLES

Enumerates the non-TEMPORARY tables currently open in the table cache.


SHOW COLLATION;
SHOW COLLATION LIKE 'latin1%';

1

SHOW PRIVILEGES

Displays a list of system permissions supported by the MySQL server. The exact output depends on the version of your server


SHOW COLLATION;
SHOW COLLATION LIKE 'latin1%';

2

SHOW PROCESSLIST

Displays which threads are running, commonly used show full processlist To see the number of mysql connections. You can also use the mysqladmin processlist Statement to get this information. If you have SUPER permissions, you can see all threads. Otherwise, you can only see your own thread

SHOW STATUS

Provides server status information. This information can also be used using the mysqladmin extended-status Command acquisition.


SHOW STATUS;

SHOW TABLE STATUS

SHOW TABLE STATUS is similar in nature to SHOW TABLE, but can provide a great deal of information for each table. You can also use the mysqlshow --status db_name Command to get this list.

This statement also displays view information.


SHOW COLLATION;
SHOW COLLATION LIKE 'latin1%';

4

SHOW TABLES

SHOW TABLES enumerates non-TEMPORARY tables in a given database. You can also use the mysqlshow db_name Command to get this list.


SHOW COLLATION;
SHOW COLLATION LIKE 'latin1%';

5

SHOW TRIGGERS

SHOW TRIGGERS lists the triggers currently defined by the MySQL server.


SHOW COLLATION;
SHOW COLLATION LIKE 'latin1%';

6

SHOW VARIABLES

View variables about configuration


SHOW COLLATION;
SHOW COLLATION LIKE 'latin1%';

7

SHOW WARNINGS

Displays error, warning, and attention messages caused by the last message-generating statement. If the last statement using the table did not generate a message, nothing is displayed. SHOW CREATE SCHEMA0 Is its related statement, showing only errors.


SHOW COUNT(*) WARNINGS;
SHOW WARNINGS;

More readers interested in MySQL can check out the topics on this site: "MySQL Query Skills Encyclopedia", "MySQL Transaction Operation Skills Encyclopedia", "MySQL Stored Procedure Skills Encyclopedia", "MySQL Database Lock Skills Encyclopedia" and "MySQL Common Functions Encyclopedia"

I hope this article is helpful to everyone's MySQL database.


Related articles: