MySQL sql_mode设置不生效,为何?
巴扎黑
巴扎黑 2017-04-17 14:42:47
0
3
929

查看sql_mode:

设置sql_mode:

SET sql_mode = 'NO_UNSIGNED_SUBTRACTION,NO_ENGINE_SUBSTITUTION';

再次查看:

退出,重启MySQL,在进入查看设置的又回去了

这是怎么回事?

巴扎黑
巴扎黑

reply all(3)
洪涛

What you set through the client is at the session level. Of course it will be invalid after restarting. If you want to set it at the global level, you need to modify it in the mysql configuration document

迷茫

1. SET global sql_mode = 'NO_UNSIGNED_SUBTRACTION,NO_ENGINE_SUBSTITUTION';
2. Add configuration under [mysqld] of my.cnf: sql_mode = NO_UNSIGNED_SUBTRACTION,NO_ENGINE_SUBSTITUTION

Ty80

How did you solve it? I also encountered the same problem

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template