1generally, by default, Sql_mode is empty, which is not a strict SQL check.2if the Sql_mode is empty, test:Create TableTT3 (nameChar(2));//define a tt3 table with a name field length of 2Insert intoTt3Values('wo');//normal insertion, flawlessInsert intoTt3Values('Woshi');//normal insertion, but the value has been truncated to "wo" modified Sql_mode to strict mode:SetSession Sql_mode= 'Strict_trans_tables'; Insert intoTt3Values('Woshi');//Error: Error1406(22001): Data tooLong for column 'name'At row1That is, strictly, the length of the field input value is strictly controlled.3.SetSession Sql_mode= 'Strict_trans_tables'; This connection takes effectSetGlobal Sql_mode= 'Strict_trans_tables'the connection does not take effect and the new connection takes effect4.SetSession Sql_mode= 'No_backslash_escapes'when turned on, the slash will be inserted as a string such asInsert intoTt3Values('\1'); , before opening the insert "1", insert after opening" \1"; 5.SetSession Sql_mode= 'Pipes_as_concat'; When turned on,||will be treated as a connector such asSelect"Beijing"|| -; returns 1 before opening, (performed or operated), and returns "beijin2008" after opening6Common Sql_mode ANSI:: Closer to Standard SQL Strict_trans_tables:: Strict mode, do not allow illegal dates, do not allow values beyond the value defined by the field length traditional:: Strict mode, insert incorrect value will directly error, Generally available at the time of the transaction