Name
SET
Syntax
SET OPTION SQL_OPTION=value
Description
Defines an option for the current session. Values set by this statement are not in effect anywhere but the current connection, and they disappear at the end of the connection. The following options are currently supported:
-
AUTOCOMMIT=0 or 1
When set to the default value of 1, each statement sent to the database is automatically committed unless preceded by
BEGIN
. Otherwise, you need to send aCOMMIT
orROLLBACK
to end a transaction.-
CHARACTER SET
charsetname
orDEFAULT
Changes the character set used by MySQL. Specifying
DEFAULT
will return to the original character set.-
LAST_INSERT_ID
=number
Determines the value returned from the
LAST_INSERT_ID( )
function.-
PASSWORD=PASSWORD('password')
Sets the password for the current user.
-
PASSWORD FOR user = PASSWORD('password')
Sets the password for the specified user.
-
SQL_AUTO_IS_NULL= 0 or 1
When set to the default value of 1, you can find the last inserted row in a table with
WHERE
auto_increment_column
IS
NULL
.-
SQL_BIG_SELECTS=0 or 1
Determines the behavior when a large
SELECT
query is encountered. If set to 1, MySQL will abort the query with an error, if the query would probably take too long to compute. MySQL decides that a query will take too long if it will have to examine more rows than the value of themax_join_size
server variable. The default value of the variable is 0, which allows all queries.-
SQL_BIG_TABLES=0 or 1
Determines the behavior of temporary tables (usually ...
Get Managing & Using MySQL, 2nd 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.