安装后如何更改mysql sql模式 [英] how to change mysql sql mode after installation

查看:33
本文介绍了安装后如何更改mysql sql模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了 mysql 并创建了表.我想从 sql 模式中删除 strict_trans_tables,怎么做?我尝试了以下内容:1) 进入 phpmyadmin 变量并编辑 sql 模式,但 mysql 将其重置为默认值

i have mysql installed and table created. i want to remove strict_trans_tables from sql mode, how to do that? I tried the fonllowing: 1) go to phpmyadmin variable and edit sql mode, but mysql reset it back to default value

2) 跟随 https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html#sql-mode-setting并尝试在命令行中重置 sql 模式:

2) followed https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html#sql-mode-setting and tried in command line to reset sql mode:

sudo mysqld --sql mode="NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

3) 找到文件 /etc/mysql/my.cnf 并尝试更改那里的设置,但没有找到任何 sql 模式信息.

3) located file /etc/mysql/my.cnf and tried to change setting there, but didn't find any sql mode info.

我可以在安装后更改 sql 模式吗?怎么样?

Can i change sql mode after installation? how?

推荐答案

3) 找到文件/etc/mysql/my.cnf 并尝试更改那里的设置,但没有找到任何 sql 模式信息

3) located file /etc/mysql/my.cnf and tried to change setting there, but didn't find any sql mode info

如果文件中没有设置任何sql模式,只需添加新行:

If you do not have any sql mode set in the file, just add new line:

sql_mode="NO_BACKSLASH_ESCAPES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

干杯

这篇关于安装后如何更改mysql sql模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆