MySQL built-in variable query

Source: Internet
Author: User
Tags one table



To view the storage engine:

Mysql> show engines;


View the InnoDB engine for all variables:

Mysql> show VARIABLES like "%innodb%";

Mysql> SHOW VARIABLES;



Set each table to use one table space independently

[Email protected] ~]# echo "innodb_file_per_table = 1" >>/etc/my.cnf

Restart takes effect:

[Email protected] ~]# service mysqld restart




Displays all the character sets supported by the current server

mysql> SHOW CHARACTER SET;


Display the default collation of a character set

Mysql> SHOW COLLATION;



To view the current global SQL model:

Method 1

Mysql> SHOW GLOBAL VARIABLES like ' Sql_mode ';


Method 2

Mysql> SELECT @ @GLOBAL. Sql_mode;


Set Server variables:

Mysql> SET [modifier] Variable name = ' variable value ';


If you set the SQL model:


mysql> SET GLOBAL @ @sql_mode = ' strict_all_tables '; # #设定全局sql_mode

mysql> SET @ @sql_mode = ' strict_all_tables '; # #设定当前会话sql_mode


Effective rules after setting the server variable


Global dynamic Variable: The new session takes effect immediately after setting;

Session dynamic Variable: the current session takes effect immediately after setting, and is not valid for other sessions;

Global static variable: need to restart service or reload to take effect;


This article is from the "Bill of Operations Notes" blog, please be sure to keep this source http://chenshoubiao.blog.51cto.com/6159058/1842665

MySQL built-in variable query

Related Article

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.