Source code editor
What Is Ajax
26.3.1: What are server SQL modes?
26.3.2: How many server SQL modes are there?
26.3.3: How do you determine the server SQL mode?
26.3.4: Is the mode dependent on the database or connection?
26.3.5: Can the rules for strict mode be extended?
26.3.6: Does strict mode impact performance?
26.3.7: What is the default server SQL mode when My SQL 5.0 is installed?
Questions and Answers
Server SQL modes define what SQL syntax MySQL should support and what kind of data validation checks it should perform. This makes it easier to use MySQL in different environments and to use MySQL together with other database servers. The MySQL Server apply these modes individually to different clients. For more information, see Section 5.2.6, “SQL Modes”.
Each mode can be independently switched on and off. See Section 5.2.6, “SQL Modes”, for a complete list of available modes.
You can set the default SQL mode (for
mysqld startup) with the
--sql-mode option. Using the statement
can change the settings from within a connection, either
locally to the connection, or to take effect globally. You
can retrieve the current mode by issuing a
A mode is not linked to a particular database. Modes can be
set locally to the session (connection), or globally for the
server. you can change these settings using
When we refer to strict mode, we mean a
mode where at least one of the modes
STRICT_ALL_TABLES is enabled. Options can
be combined, so you can add additional restrictions to a
mode. See Section 5.2.6, “SQL Modes”, for more
The intensive validation of input data that some settings requires more time than if the validation is not done. While the performance impact is not that great, if you do not require such validation (perhaps your application already handles all of this), then MySQL gives you the option of leaving strict mode disabled. However — if you do require it — strict mode can provide such validation.
By default, no special modes are enabled. See Section 5.2.6, “SQL Modes”, for information about all available modes and MySQL's default behavior.
Source code editor What Is Ajax