The scope of the mysql set keyword.

SET var_name = value
enables you to assign values to variables that affect the operation of the server or clients.
Many system variables are dynamic and can be changed at runtime by using the SET statement.

SET var_name = value
enables you to assign values to variables that affect server or client operations. Many system variables are dynamic and can be changed at run time using set statements

so does the system variable set by set remain in effect while mysql is running?
seems to be the current session, during its effective period, so how is session defined?
(the definition of duration is not found in the official manual 18.2.1 MySQL Shell Sessions)
will it be overridden by the settings in my.ini only after restarting mysql?

Mar.23,2021

  1. the validity period of session is that connection,connection is disconnected and session is terminated.
  2. set defaults to the session variable. As mentioned above, as long as connection disconnects the session variable, it disappears, and after the next reconnection, the session variable returns to its initial value. Of course, if you don't want the variable to fail, you can modify the global variable with the global parameter when you set.

connection on the command line is the period from mysql to exit. Then the executed sql file belongs to the current session, and will not start another session.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e543b6-45282.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e543b6-45282.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?