mysql show simple operation example

mysql show simple operation example

This article describes the mysql show operation with examples. Share with you for your reference, the details are as follows:

SHOW CHARACTER SET

Displays all available character sets

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

SHOW COLLATION

The output includes all available character sets

SHOW COLLATION;
SHOW COLLATION LIKE 'latin1%';

SHOW COLUMNS

Displays information about the columns in a given table. This statement also works for views.

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

SHOW CREATE DATABASE

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

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

SHOW CREATE TABLE

Show the sql statement to create a table

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

SHOW DATABASES

SHOW DATABASES lists the databases on the MySQL server host. You can also get this list using the mysqlshow command. You can see only databases for which you have some privilege, unless you have the global SHOW DATABASES privilege.

SHOW DATABASES;

SHOW ENGINE

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

SHOW ENGINE BDB LOGS;
SHOW ENGINE INNODB STATUS;

SHOW ENGINES

SHOW ENGINES displays status information about storage engines. 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 only errors, not errors, warnings, and notes.

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 INDEX FROM mydb.mytable;
SHOW INDEX FROM mytable FROM mydb;

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

View server information and locate problems

This is a deprecated synonym for SHOW ENGINE INNODB STATUS .

SHOW OPEN TABLES

Lists the non-TEMPORARY tables that are currently open in the table cache.

SHOW OPEN TABLES;

SHOW PRIVILEGES

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

SHOW PRIVILEGES;

SHOW PROCESSLIST

Shows which threads are running. show full processlist is often used to view the number of MySQL connections. You can also use mysqladmin processlist statement to obtain this information. If you have the SUPER privilege, you can see all threads. Otherwise, you can only see your own threads

SHOW STATUS

Provides server status information. This information is also available using the mysqladmin extended-status command.

SHOW STATUS;

SHOW TABLE STATUS

SHOW TABLE STATUS is similar in nature to SHOW TABLE, but provides extensive information about each table. You can also get this list using the mysqlshow --status db_name command.

This statement also displays view information.

SHOW TABLE STATUS;
SHOW TABLE STATUS FROM test;

SHOW TABLES

SHOW TABLES lists the non-TEMPORARY tables in a given database. You can also get this list using the mysqlshow db_name command.

SHOW TABLES;

SHOW TRIGGERS

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

SHOW TRIGGERS;

SHOW VARIABLES

View configuration variables

SHOW GLOBAL VARIABLES;
SHOW SESSION VARIABLES;
SHOW VARIABLES LIKE 'have%';

SHOW WARNINGS

Displays error, warning, and notice messages resulting from the last statement that generated a message. If the last statement using the table did not generate a message, nothing is displayed. SHOW ERRORS is a related statement that displays only errors.

SHOW COUNT(*) WARNINGS;
SHOW WARNINGS;

Readers who are interested in more MySQL-related content can check out the following topics on this site: "MySQL query skills", "MySQL transaction operation skills", "MySQL stored procedure skills", "MySQL database lock related skills summary" and "MySQL common function summary"

I hope this article will be helpful to everyone's MySQL database design.

You may also be interested in:
  • How to check mysql locks through mysql show processlist command
  • mysql show processlist displays the mysql query process
  • The show command method in MySQL obtains detailed information about the table and the entire database (fine collection)
  • How to use SHOW PROFILE command to analyze performance in MySQL
  • Usage of MySQL show command
  • How to get table information in MySQL show table status
  • Detailed introduction to the use of show command in MySQL
  • MySQL uses show status to view MySQL server status information
  • Introduction to the use of MySQL SHOW command
  • MySQL SHOW PROCESSLIST assists in the entire process of troubleshooting
  • Explanation of MySQL performance inspection through show processlist command

<<:  How to solve the problem of -bash: /usr/bin/yum: No such file or directory after typing yum in linux

>>:  JavaScript to add and delete messages on the message board

Recommend

Summary of 7 pitfalls when using react

Table of contents 1. Component bloat 2. Change th...

How to deploy k8s in docker

K8s k8s is a cluster. There are multiple Namespac...

How to run the springboot project in docker

1. Click Terminal below in IDEA and enter mvn cle...

Application of anchor points in HTML

Set Anchor Point <a name="top"><...

Preventing SQL injection in web projects

Table of contents 1. Introduction to SQL Injectio...

MySQL gets the current date and time function

Get the current date + time (date + time) functio...

What does this.parentNode.parentNode (parent node of parent node) mean?

The parent node of the parent node, for example, t...

TypeScript namespace merging explained

Table of contents Merge namespaces with the same ...

...

mysql5.7.20 installation and configuration method graphic tutorial (mac)

MySQL 5.7.20 installation and configuration metho...

How to add a paging navigation bar to the page through Element UI

need Add a paging bar, which can jump to the page...

Introduction to ApplicationHost.config (IIS storage configuration area file)

For a newly created website, take ASP.NET MVC5 as...

Research on the problem of flip navigation with tilted mouse

In this article, we will analyze the production of...

Detailed explanation of MYSQL database table structure optimization method

This article uses an example to illustrate the me...