mysqldump unknown option no beep

自闭症网瘾萝莉.ら 提交于 2019-11-26 20:51:59

问题


I'm running MySQL 5.5 on Windows, attempting a 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'

This is a pretty basic command, and works on two other development boxes, so not sure what is causing this?


回答1:


Same issue, commented out (#) the no-beep line in the MySQL my.ini, solved the problem.




回答2:


I found this answer on dba.stackexchange.com, which is very helpful:

The no-beep option causes the mysql command line client not to beep when errors occur.

If that's an option you want, it should be in the [mysql] section of your my.cnf [or my.ini]. This error suggests that it's in the [client] section of your my.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.

-- http://dev.mysql.com/doc/refman/5.6/en/option-files.html




回答3:


Something in an environment variable or my.cnf file?

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

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.)




回答4:


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.

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.

Deleting C:\Program Files\MySQL\MySQL Server 5.6\my.ini solves the problem.




回答5:


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.




回答6:


One note relating to this, you have to be aware of your various installed MySQL products. The following scenario best explains it.

  • 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)

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.




回答7:


Alternate solution is to use --no-defaults option

Eg : mysqldump --no-defaults -u root -p [DB_NAME] > [FILE_NAME].sql




回答8:


Removing my.ini from C:\ProgramData\MySQL\MySQL Server 5.6 solved it for me.



来源:https://stackoverflow.com/questions/14210769/mysqldump-unknown-option-no-beep

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!