将 .my.cnf 提供给 mysql 命令行

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12512814/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 14:55:19  来源:igfitidea点击:

Give .my.cnf to mysql command line

mysqlcommand-line

提问by Philippe Blayo

How to give a specific .my.cnf config file to the mysql command line?

如何将特定的 .my.cnf 配置文件提供给 mysql 命令行?

$ mysql --my-config=.my.cnf

回答by Brian Showalter

The --defaults-file option lets you specify which options file you want to use. It would be a good idea to give it the full path to your options file.

--defaults-file 选项允许您指定要使用的选项文件。最好为其提供选项文件的完整路径。

mysql --defaults-file=/home/user/.my.cnf database

回答by ethrbunny

In here: http://dev.mysql.com/doc/refman/5.5/en/option-files.htmlit says you can also specify "defaults-extra-file" for additional params. Otherwise it defaults to the various my.cnf (depending on OS).

在这里:http: //dev.mysql.com/doc/refman/5.5/en/option-files.html它说您还可以为其他参数指定“defaults-extra-file”。否则它默认为各种 my.cnf(取决于操作系统)。