在应用程序中更改mysql的sql_mode [英] Change sql_mode of mysql in app

查看:101
本文介绍了在应用程序中更改mysql的sql_mode的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个基于php和mysql的Web应用程序.我需要将mysql的sql_mode设置为"ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"我尝试使用命令SET GLOBAL sql_mode来执行此操作,但是过一会儿sql_mode是 重启. C

I have a web app based on php and mysql. I need to set the sql_mode of mysql to "ERROR_FOR_DIVISION_BY_ZERO, NO_AUTO_CREATE_USER, NO_ENGINE_SUBSTITUTION" I tried to do it with the command SET GLOBAL sql_mode but after a while the sql_mode is reset. Can someone explain to me how to do it?

推荐答案

嗨费德里科,

请查看以下堆栈溢出线程:在mysql中设置全局sql_mode

Please take a look at the following Stack Overflow thread: setting global sql_mode in mysql

要永久设置这些参数,您将需要访问mysql.cnf文件,以便在每次重新启动后仍保留所需的配置.由于MySQL的Azure数据库是PaaS产品,因此您无权访问此文件.唯一的途径 您拥有的是通过Azure Portal服务器属性刀片.如果未列出它们,那么您唯一的选择就是临时设置它们,直到服务器重新启动为止.

To set these parameters permanently, you will need access to the mysql.cnf file so that after every restart the desired configuration is persisted. Because the Azure Database for MySQL is a PaaS offering, you do not have access to this file. The only access you have is through the Azure Portal server properties blade. If they are not listed then your only option is to set them the way you have on a temporary basis, until the server is restarted. 

我希望这会有所帮助.如果您还有其他问题,请告诉我们.

I hope this helps. Please let us know if you have additional questions.

关于麦克,


这篇关于在应用程序中更改mysql的sql_mode的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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