How to run MySQL in ANSI mode

Source: Internet
Author: User
Tags mysql in

You can use the "--ansi" startup option to require MYSQLD to use ANSI mode.

Running the server in ANSI mode is the same as the effect of starting it with this option (specifying the "--sql_mode" value on one line):

--transaction-isolation=SERIALIZABLE
--sql-mode=REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,
IGNORE_SPACE

In MySQL4.1, you can use the following two statements to achieve the same effect (Specify a "Sql_mode" value on one line):

SET GLOBAL TRANSACTION ISOLATION LEVEL SERIALIZABLE;
SET GLOBAL sql_mode = 'REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,
IGNORE_SPACE';

In the MySQL 4.1.1, you can also set the Sql_mode option with the following statement:

SET GLOBAL sql_mode='ansi';

In this case, set the value of the Sql_mode variable to all the options associated with ANSI mode. You can check the results as follows:

mysql> SET GLOBAL sql_mode='ansi';
mysql> SELECT @@global.sql_mode;
   -> 'REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,
IGNORE_SPACE,ANSI';

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.