在MariaDB上禁用严格模式

时间:2019-08-06 17:40:02

标签: mariadb mode strict disable

当我在phpmyadmin中运行此sql

SELECT @@SQL_MODE, @@GLOBAL.SQL_MODE; 

它显示

@@SQL_MODE STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION 

@@GLOBAL.SQL_MODE STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION 

如何使用phpmydmin在MariaDB上禁用严格模式?

2 个答案:

答案 0 :(得分:0)

通过SSH编辑

/etc/my.cnf文件

添加

sql_mode=NO_ENGINE_SUBSTITUTION

重新启动MariaDB

它将解决此问题

答案 1 :(得分:0)

这对我有用:

root@MaRs:/etc/mysql# cat my.cnf|grep -v \#

[client-server]

!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mariadb.conf.d/

[mysqld]
sql_mode=NO_ENGINE_SUBSTITUTION
root@MaRs:/etc/mysql# 

MariaDB [(none)]> SELECT @@SQL_MODE, @@GLOBAL.SQL_MODE; 
+------------------------+------------------------+
| @@SQL_MODE             | @@GLOBAL.SQL_MODE      |
+------------------------+------------------------+
| NO_ENGINE_SUBSTITUTION | NO_ENGINE_SUBSTITUTION |
+------------------------+------------------------+
1 row in set (0.000 sec)