Mysql Mode On Linux CentOS

I installed Mysql 5.6 On CentOS Linux By Default it Set SQl Mode Strict

 SELECT @@GLOBAL.sql_mode;
+--------------------------------------------+
| @@GLOBAL.sql_mode                          |
+--------------------------------------------+
| STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION |

 SELECT @@SESSION.sql_mode;
+--------------------------------------------+
| @@SESSION.sql_mode                         |
+--------------------------------------------+
| STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION |
+--------------------------------------------+

I changed sql_mode via command line from root User to none via command

SET SESSION sql_mode = '';
SET GLOBAL sql_mode = '';

After this i executed commands above commands and they showed

 SELECT @@SESSION.sql_mode;
+--------------------+
| @@SESSION.sql_mode |
+--------------------+
|                    |
+--------------------+
1 row in set (0.00 sec)

mysql> SELECT @@GLOBAL.sql_mode;
+-------------------+
| @@GLOBAL.sql_mode |
+-------------------+
|                   |
+-------------------+
1 row in set (0.00 sec)

But when i restarted Mysql Server i again set Strict Mode ie

 SELECT @@GLOBAL.sql_mode;
+--------------------------------------------+
| @@GLOBAL.sql_mode                          |
+--------------------------------------------+
| STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION |

 SELECT @@SESSION.sql_mode;
+--------------------------------------------+
| @@SESSION.sql_mode                         |
+--------------------------------------------+
| STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION |
+--------------------------------------------+

I also added mysql-mode="" in my.cnf file but result was same after restarting mysql


Add in your my.cnf file :

sql_mode = ""

Then restart mysql

Here is what it should look like :

user        = nobody
port        = 3306
socket      = /opt/lampp/var/mysql/mysql.sock
skip-external-locking
key_buffer = 16M
max_allowed_packet = 1M
table_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
open_files_limit = 50k
sql_mode = ""
链接地址: http://www.djcxy.com/p/75346.html

上一篇: 匹配字符串的第一个字,然后匹配第二个字母

下一篇: MySQL CentOS上的Mysql模式