如何全局设置自动提交错误 [英] how to set autocommit false globally

查看:275
本文介绍了如何全局设置自动提交错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须将autocommit设置为false,并且已经在my.cnf配置文件中进行了更改.

I have to set autocommit to false, and I have done the changes in my.cnf configuration file.

我已经添加了autocommit=0来设置globally autocommit OFF,但是在我的my.cnf文件中添加了autocommit=0属性之后,我的sql服务器没有启动.

I have added autocommit=0 for setting globally autocommit OFF but after adding autocommit=0 property in my my.cnf file my sql server not started.

但是当我评论这个新添加的行时,我的sql server正常启动了.

But when I comment this new added line my sql server started properly.

我正在使用"/etc/init.d/mysql start"此命令启动sql服务器.

I m starting my sql server with "/etc/init.d/mysql start" this command.

设置autocommit false有什么错误吗?

如果是这样,那么任何人都可以告诉我我该怎么做?

If so, then anyone please tell me how I can do that?

请尽快回复我.

谢谢.

推荐答案

http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html#sysvar_autocommit

要使用选项文件设置变量,请包括以下几行:

To set the variable as just shown using an option file, include these lines:

[mysqld]
init_connect='SET autocommit=0'

这篇关于如何全局设置自动提交错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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