MySQL Advanced SQL statement

Source: Internet
Author: User

Show Processlist; only the first 100 are listed, if you want to list them all please use show full processlist to download ;

Show columns from table_name to database_name; or show columns from database_name.table_name; or show fields;

Explanation: Displays the column names in the table (and the effect of the DESC table_name command is the same)

View the number of connections, status

Show variables like '%max_connections% '

Command line login after MySQL. Set the new MySQL maximum number of connections to 200:
Mysql> set global max_connections=200.

Show Processlist;

KILL QUERY thread_id;

Show index from user;

Or

Show keys from user;

Explanation: Displaying the index of a table

Show status;

Explanation: Displays information about some system-specific resources, such as the number of threads that are running

Show variables;

Explanation: Display the name and value of a system variable

Show privileges;

Explanation: Display different permissions supported by the server

Show CREATE DATABASE database_name;

Explanation: Displays the SQL statement that created the specified database

Show CREATE TABLE table_name;

Explanation: Displays the SQL statement that created the specified data table

Show InnoDB status;

Explanation: Displaying the status of the InnoDB storage engine

Show logs;

Explanation: Displaying logs for the BDB storage engine

Show warnings;

Explanation: Displays errors, warnings, and notifications generated by the last statement executed

Show errors;

Explanation: Display only the error resulting from the last execution statement

SELECT now (), version ();


MySQL Advanced SQL statement

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.