SET PERSIST_ONLY back_log = 1000; SET @@PERSIST_ONLY.back_log = 1000; 

•Set a session system variable: 

SET SESSION sql_mode = ’TRADITIONAL’; SET @@SESSION.sql_mode = ’TRADITIONAL’; SET @@sql_mode = ’TRADITIONAL’; 

For complete details about SET  syntax, see Section 13.7.6.1, “SET Syntax for Variable Assignment” . For a description of the privilege requirements for setting and persisting system variables, see Section 5.1.9.1, “System Variable Privileges” 

Suffixes for specifying a value multiplier can be used when setting a variable at server startup, but not to set the value with SET  at runtime. On the other hand, with SET  you can assign a variable’s value using an expression, which is not true when you set a variable at server startup. For example, the first of the following lines is legal at server startup, but the second is not: 

shell> mysql --max_allowed_packet=16M shell> mysql --max_allowed_packet=16*1024*1024 

Conversely, the second of the following lines is legal at runtime, but the first is not: 

mysql> SET GLOBAL max_allowed_packet=16M; mysql> SET GLOBAL max_allowed_packet=16*1024*1024; 

To display system variable names and values, use the SHOW VARIABLES  statement: 

mysql> SHOW VARIABLES; +---------------------------------+-----------------------------------+ | Variable_name | Value | +---------------------------------+-----------------------------------+ | auto_increment_increment | 1 | | auto_increment_offset | 1 | | automatic_sp_privileges | ON | | back_log | 151 | | basedir | /home/mysql/ | | binlog_cache_size | 32768 | | bulk_insert_buffer_size | 8388608 | | character_set_client | utf8 | | character_set_connection | utf8 | | character_set_database | utf8mb4 | | character_set_filesystem | binary | | character_set_results | utf8 | | character_set_server | utf8mb4 | | character_set_system | utf8 | | character_sets_dir | /home/mysql/share/mysql/charsets/ | | collation_connection | utf8_general_ci | | collation_database | utf8mb4_0900_ai_ci | | collation_server | utf8mb4_0900_ai_ci | ... | innodb_autoextend_increment | 8 | | innodb_buffer_pool_size | 8388608 | | innodb_commit_concurrency | 0 | | innodb_concurrency_tickets | 500 | | innodb_data_file_path | ibdata1:10M:autoextend | | innodb_data_home_dir | | ... | version | 8.0.1-dmr-log | | version_comment | Source distribution | | version_compile_machine | i686 | | version_compile_os | suse-linux | | wait_timeout | 28800 | +---------------------------------+-----------------------------------+ 

