24.8. Setting the Default SQL Mode


MySQL Server has a configurable SQL mode that provides control over aspects of query processing such as how strict or forgiving the server is about accepting input data, and whether to enable or disable behaviors relating to standard SQL conformance.

By default, the SQL mode value is empty, so no special restrictions or conformance behaviors are enabled. Individual clients can configure the SQL mode for their own requirements, but it's also possible to set the default SQL mode at server startup with the --sql-mode option. You might do this to run the server with a mode that is more careful about accepting invalid data or creating MySQL user accounts. For example, if you enable TRADITIONAL mode, the server enforces restrictions on input data values that are like other (more "traditional") database servers, rather than MySQL's more forgiving behavior. It also will not allow new user accounts to be created with the GRANT statement unless a password is specified. You can enable TRADITIONAL SQL mode by placing the following lines in an option file:

 [mysqld] sql-mode=TRADITIONAL 

Further information about the SQL mode can be found in Section 1.3, "Server SQL Modes," and Section 5.8, "Handling Missing or Invalid Data Values."



MySQL 5 Certification Study Guide
MySQL 5.0 Certification Study Guide
ISBN: 0672328127
EAN: 2147483647
Year: 2006
Pages: 312

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net