mySQL:编辑/保存 my.cnf 文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11632733/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
mySQL: editing/saving my.cnf file
提问by Peeyush Kushwaha
I have found the sample configuration files provided with mysql 5.0
, but I am not able to save them, when I edit them. I also tried saving using a different file name but I received an error by windows
saying that I don't have permission to save file in that location (I am an administrator
).
我找到了随 提供的示例配置文件mysql 5.0
,但在编辑它们时无法保存它们。我还尝试使用不同的文件名进行保存,但收到错误消息,windows
提示我无权在该位置保存文件 ( I am an administrator
)。
I need to edit the configuration file so I am able to save more data. I really can't figure out how to do it and have been struck on this problem since hours. anyone who can figure out whats going on?
我需要编辑配置文件,以便能够保存更多数据。我真的不知道该怎么做,并且几个小时以来一直在解决这个问题。谁能弄清楚发生了什么?
回答by ashish khare
to edit my.cnf
file in linux opensuse 11.3
first of all open terminal window in su mode
then go to the directory /etc
then open my.cnf
file in any of the text editor(kwrite);
now just insert the following two parameters after the line [mysqld]
my.cnf
在 linux opensuse 11.3 中编辑文件
首先在 su 模式下打开终端窗口,
然后转到目录 /etc
然后my.cnf
在任何文本编辑器(kwrite)中打开文件;
现在只需在 [mysqld] 行后插入以下两个参数
wait_timeout=50
interactive_timeout=50
save and exit;
restart mysql;
now u can set your session time out by using the following:
保存并退出;
重启mysql;
现在您可以使用以下方法设置会话超时:
set wait_timeout=5000;<br>
it is persistent
它是持久的
回答by user1934863
I see that the basic information was included in directing someone to edit the my.cnf; however, there is no step by step available for beginners. I have a great article with step by step instructions and graphics that explains how to get the MySQL settings and how to change the my.cnf as root through shell. Hope the article helps.
我看到在指导某人编辑my.cnf时包含了基本信息;然而,初学者没有一步一步可用。我有一篇很棒的文章,其中包含分步说明和图形,解释了如何获取 MySQL 设置以及如何通过 shell 以 root 身份更改 my.cnf。希望文章有帮助。
How to edit the MySQL my.cnf file
Regards, James R
问候, 詹姆斯 R
回答by Omesh
You need to have root permissions on my.cnf file to edit it.
您需要对 my.cnf 文件具有 root 权限才能对其进行编辑。
So login using root user and then you will be able to edit my.cnf and then you need to restart MySQL server in order to reflect changes.
所以使用root用户登录,然后您将能够编辑my.cnf,然后您需要重新启动MySQL服务器以反映更改。