MySQL CentOS上的Mysql模式
我在CentOS Linux上安装Mysql 5.6默认情况下,它严格设置SQl模式
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 | +--------------------------------------------+
我通过命令行将root用户更改为sql_mode
SET SESSION sql_mode = ''; SET GLOBAL sql_mode = '';
在这之后,我执行了上面命令的命令并且显示出来
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)
但是,当我重新启动MySQL服务器我再次设置严格模式即
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 | +--------------------------------------------+
我还在my.cnf文件中添加了mysql-mode =“”,但重启mysql后结果相同
添加你的my.cnf文件:
sql_mode = ""
然后重新启动mysql
以下是它的外观:
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/75345.html