SET [OPTION] option=value,...

Description: Sets options that govern the operation of the client or the server. Unless specified, options take effect immediately; however, the next time the client is restarted, they go back to either the default values, or the values in the various config files (such as /etc/my.cnf), which will override the defaults.

The client options only live until the thread exits.

The keyword OPTION has no effect. The possible syntax for option=value is given in Table B.2.

Table B.2. Options for SET SQL_VALUE_OPTION
Syntax for option=valueAction Performed
AUTOCOMMIT={0|1}Turns autocommit mode on (1) or off (0). If set to 0, all updates will require a COMMIT or ROLLBACK to tell MySQL to accept or revoke the transaction.
CHARACTER ...

Get Sams Teach Yourself MySQL in 21 Days, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.