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