我正在尝试使用命令行上的 --defaults-file 选项登录 mysql:
$ mysql --defaults-file ~/mycnf.cnf
但我收到以下错误:
mysql: unknown option '--defaults-file'
但是这个选项在帮助中列出:
$ mysql --help
...
Default options are read from the following files in the given order:
/etc/mysql/my.cnf /etc/my.cnf ~/.my.cnf
The following groups are read: mysql client
The following options may be given as the first argument:
--print-defaults Print the program argument list and exit.
--no-defaults Don't read default options from any option file.
--defaults-file=# Only read default options from the given file #.
--defaults-extra-file=# Read this file after the global files are read.
--defaults-file=# Only read default options from the given file #.
这里发生了什么?这是 mysql --version 的输出
$ mysql --version
mysql Ver 14.14 Distrib 5.1.69, for redhat-linux-gnu (x86_64) using readline 5.1