简体   繁体   English

mysqldump 无法识别数据库名称?

[英]mysqldump not recognizing database name?

I am trying to export all of the tables of one of my databases "gamestore" located on localhost, to an xml file.我正在尝试将位于本地主机上的我的一个数据库“gamestore”的所有表导出到 xml 文件。 I open command prompt as administrator and run this command:我以管理员身份打开命令提示符并运行以下命令:

C:\Program Files\MySQL\MySQL Server 8.0\bin>mysqldump --xml -u root -p gamestore > backup.xml;

I am prompted for a password, and I enter the correct one, but then I'm given an error:系统提示我输入密码,我输入了正确的密码,但随后出现错误:

mysqldump: Couldn't find table: ";"

I'm not sure what's causing this.我不确定是什么原因造成的。 Any advice?有什么建议吗?

If I reenter the command as:如果我重新输入命令:

C:\Program Files\MySQL\MySQL Server 8.0\bin>mysqldump --xml -u root -p --databases gamestore > backup.xml;

and enter the correct password, I still get an error:并输入正确的密码,我仍然得到一个错误:

mysqldump: Got error: 1049: Unknown database ';' when selecting the database

Just get rid of the trailing semicolon in your command.只需去掉命令中的尾随分号即可。

During parsing of > backup.xml; > backup.xml; the Windows command processor turns it into effectively Windows 命令处理器将其有效地转化为

mysqldump --xml -u root -p --databases gamestore ;

with the redirection enabled, and MySQLDump gets confused about that now-extra semicolon.启用重定向后,MySQLDump 对现在多余的分号感到困惑。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM