MySQL mysqldump 未知选项没有哔声
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14210769/
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
mysqldump unknown option no beep
提问by JustBaron
I'm running MySQL 5.5 on Windows, attempting a mysqldump:
我在 Windows 上运行 MySQL 5.5,尝试 mysqldump:
"C:\WebServer\MySQL Server 5.5\bin\mysqldump.exe" -u user -ppassword database > "C:\backup.sql"
But get error:
但得到错误:
mysqldump: unknown option '--no beep'
mysqldump: 未知选项 '--no beep'
This is a pretty basic command, and works on two other development boxes, so not sure what is causing this?
这是一个非常基本的命令,适用于另外两个开发盒,所以不确定是什么原因造成的?
回答by Matt
Same issue, commented out (#) the no-beep line in the MySQL my.ini, solved the problem.
同样的问题,在 MySQL my.ini 中注释掉 (#) no-beep 行,解决了问题。
回答by naitsirch
I found this answeron dba.stackexchange.com, which is very helpful:
我在 dba.stackexchange.com 上找到了这个答案,非常有帮助:
The
no-beep
optioncauses themysql
command line client not to beep when errors occur.If that's an option you want, it should be in the
[mysql]
section of yourmy.cnf
[or my.ini]. This error suggests that it's in the[client]
section of yourmy.cnf
, which causes [...] to throw the error since the option isn't recognized.Check your
my.cnf
and either remove the line or place it in the[mysql]
section instead of[client]
and you should be good.The [client] option group is read by all client programs (but not by mysqld). This enables you to specify options that apply to all clients. For example, [client] is the perfect group to use to specify the password that you use to connect to the server. (But make sure that the option file is readable and writable only by yourself, so that other people cannot find out your password.) Be sure not to put an option in the [client] group unless it is recognized by all client programs that you use. Programs that do not understand the option quit after displaying an error message if you try to run them.
该
no-beep
选项会导致mysql
命令行客户端在发生错误时不发出哔哔声。如果这是您想要的选项,它应该在
[mysql]
您的my.cnf
[或 my.ini] 部分中。此错误表明它位于[client]
your的部分my.cnf
,这会导致 [...] 抛出错误,因为无法识别该选项。检查您的
my.cnf
并删除该行或将其放置在该[mysql]
部分而不是[client]
您应该很好。[client] 选项组由所有客户端程序读取(但不是由 mysqld)。这使您能够指定适用于所有客户端的选项。例如,[client] 是用于指定用于连接到服务器的密码的完美组。(但要确保选项文件只有你自己可读可写,这样其他人就无法找到你的密码。)一定不要把选项放在 [client] 组中,除非它被你的所有客户端程序识别用。如果您尝试运行不理解该选项的程序,则会在显示错误消息后退出。
回答by ysth
Something in an environment variable or my.cnf file?
环境变量或 my.cnf 文件中的某些内容?
For what it's worth, when I put the no-beep option (a valid option for the mysql client, but not for mysqldump) in the [client]
section of my config file, I get
对于它的价值,当我在[client]
配置文件的部分中放置 no-beep 选项(mysql 客户端的有效选项,但不是 mysqldump 的有效选项)时,我得到
mysqldump: unknown option '--no-beep'
(As mentioned in naitsirch's answer, it should be moved from the [client]
section to the [mysql]
section so it doesn't try to use it for other client programs such as mysqldump.)
(正如naitsirch 的回答中提到的,它应该从[client]
部分移动到[mysql]
部分,这样它就不会尝试将它用于其他客户端程序,例如 mysqldump。)
回答by user3470332
Despite removing the -no--beep otion from the client section in the my.ini file specified in the properties of the mysql service, the problem persisted. The MYSQL56 service set up was using my.in from E:\Program Data\MySQL\MySQL Server 5.6\ . And this ini file had no -no--beep option under the [client] section.
尽管从 mysql 服务属性中指定的 my.ini 文件的 client 部分中删除了 -no--beep 选项,但问题仍然存在。MYSQL56 服务设置使用来自 E:\Program Data\MySQL\MySQL Server 5.6\ 的 my.in 。这个 ini 文件在 [client] 部分下没有 -no--beep 选项。
So what was the problem?
那么问题出在哪里呢?
In my setup, mysqldump.exe is residing at C:\Program Files\MySQL\MySQL Server 5.6\bin. When running this as a command line option, mysql was using C:\Program Files\MySQL\MySQL Server 5.6\my.ini. This ini file contained the no--beep option in it. mysqldump was not using the my.ini specified by the service but rather the one directory up.
在我的设置中,mysqldump.exe 位于 C:\Program Files\MySQL\MySQL Server 5.6\bin。将此作为命令行选项运行时,mysql 使用的是 C:\Program Files\MySQL\MySQL Server 5.6\my.ini。这个 ini 文件中包含 no--beep 选项。mysqldump 没有使用服务指定的 my.ini,而是使用了一个目录。
Deleting C:\Program Files\MySQL\MySQL Server 5.6\my.ini solves the problem.
删除 C:\Program Files\MySQL\MySQL Server 5.6\my.ini 即可解决问题。
回答by brentil
One note relating to this, you have to be aware of your various installed MySQL products. The following scenario best explains it.
与此相关的一个注意事项,您必须了解已安装的各种 MySQL 产品。下面的场景最好地解释了它。
- C:\Program Files\MySQL\MySQL Server 5.5\my.ini (created from a previous installation)
- C:\Program Files\MySQL\MySQL Server 5.6\my.ini (someone copied this here, who knows why)
- C:\Program Files\MySQL\my.ini (created by MySQL Installer Config Wizard)
- C:\Program Files\MySQL\MySQL Server 5.5\my.ini(从以前的安装创建)
- C:\Program Files\MySQL\MySQL Server 5.6\my.ini(有人复制了这里,谁知道为什么)
- C:\Program Files\MySQL\my.ini(由 MySQL 安装程序配置向导创建)
So you might assume that the MySQL Workbench draws settings from the my.ini
file inside of the MySQL version you're working against. This would be a safe assumption as part of setting up a configuration for administration in the Workbench requires pointing to the my.ini
specific to that installation. However that is incorrect as I've found it latches onto the one located at C:\Program Files\MySQL\my.ini
as the one to use. You thus have to edit this file to get the Workbench to function correctly.
因此,您可能会假设 MySQL Workbench 从my.ini
您正在使用的 MySQL 版本内的文件中提取设置。这将是一个安全的假设,因为在 Workbench 中设置管理配置的一部分需要指向my.ini
该安装的特定位置。然而,这是不正确的,因为我发现它锁定在C:\Program Files\MySQL\my.ini
作为使用的那一个上。因此,您必须编辑此文件才能使 Workbench 正常运行。
回答by des-chain
Deleting the no-beep option worked for me, but I had to change the my.ini file in my windows directory! I'm using windows 10 by the way.
删除 no-beep 选项对我有用,但我必须更改windows 目录中的my.ini 文件!顺便说一下,我正在使用 Windows 10。
回答by Subhash
Alternate solution is to use --no-defaults
option
替代解决方案是使用--no-defaults
选项
Eg : mysqldump --no-defaults -u root -p [DB_NAME] > [FILE_NAME].sql
例如: mysqldump --no-defaults -u root -p [DB_NAME] > [FILE_NAME].sql
回答by Enzo Pandulce
solved it for me too
也帮我解决了
C:\ProgramData\MySQL\MySQL Server 8.0
C:\ProgramData\MySQL\MySQL 服务器 8.0
reboot pc
重启电脑
回答by Susanta
Removing my.ini
from C:\ProgramData\MySQL\MySQL Server 5.6
solved it for me.
删除my.ini
从C:\ProgramData\MySQL\MySQL Server 5.6
解决对我来说。