从mysql my.cnf里面读取文件

时间:2015-08-14 05:22:28

标签: mysql

我知道mysql可以从my.cnf读取用户名和密码,如下所示,

[mysql]
user=root
password=myrootpassword

然而。如果我必须从my.cnf里面的另一个文件中读取密码,我该怎么做?例如,如下所示,

[mysql]
user=root
password=/path/to/a/file/containing/password

提前致谢!

1 个答案:

答案 0 :(得分:1)

您可以使用指令!include来指定MySQL .cnf文件中的另一个配置文件 - 类似于:

!include /path/to/a/file/containing/password.cnf

然后在指定文件中提供密码。

在此处查看更多内容 - http://dev.mysql.com/doc/refman/5.7/en/option-files.html

相关问题