MySQL数据备份"--no-beep"异常解决

来源:互联网 发布:c语言for循环语句 编辑:程序博客网 时间:2024/06/15 08:04

今天使用AppServ集成环境下的MySQL进行数据备份,出现一个ERROR,如下:

mysqldump: [ERROR] unknown option '--no-beep'

查询资料,得到一个比较靠谱的说法,如下:

There is a "default" my.ini here: C:\ProgramData\MySQL\MySQL Server 5.7\my.ini.It contains the no-beep option.The MySQL Installer has my.ini templates for various versions in C:\ProgramData\MySQL\MySQL Installer for Windows\Manifest\Templates\, for some reason, all of it contains this option.                                                            

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.

关于解决办法:

Removing my.ini from C:\ProgramData\MySQL\MySQL Server 5.6 solved it for me.
关于这个解决方法,被人在下面回复了一句:Not a good idea to remove the my.ini file (我也觉得不怎么好,于是又找方法)

后我利用如下语句进行备份数据,成功备份,但有一个警告,数据无恙,语句如下:

mysqldump --no-defaults -uroot -ppwd -h127.0.0.1 --databases fendao > D:\ksk.txt

上面结论参考于:

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

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

原创粉丝点击