1. Modify the My.ini configuration file, if the simplest way to set a global parameter is to write the parameter configuration directly in the My.ini file, as shown in. Restarting the database service enables the global parameters to take effect.
As shown, all the parameters in the new session are in effect.
2. On the basis of not modifying the configuration file, set global parameters, set globally autocommit=1; Sets the value of the autocommit parameter to ON
The parameters in the other session window are not in effect
It can be seen that the global parameters are set, but the autocommit parameters that have been queried have not changed. Did we fail to set it up? No, you need to reopen a session window to be a global parameter.
As shown in the newly opened window, the display parameter settings are already in effect. so the global parameter setting is not valid for the session that is already open, but it is effective for the newly opened session.
3. Modify the session parameter configuration, set session autocommit=1, only the parameter configuration for this session is valid, for the other session is not valid.
The configuration of the other session is not in effect, as shown in
4. Although the global variables are set, after the MySQL service restarts, the configuration of the database is reinitialized, and everything is initialized according to the My.ini configuration. Both the global and session configurations will fail.
MySQL basic--global parameters and session parameters settings