在MySQL中转储数据库 [英] dumping DB in mysql
问题描述
当我运行以下语句时,mysql抱怨出现错误.
when I run below statement, mysql is complaining having error.
mysqldump --triggers --routines -u root -p mydb > mydb_20120924.dmp;
mysql版本:5.1.34
mysql version: 5.1.34
您的SQL语法有错误;检查手册 对应于您的MySQL服务器版本以使用正确的语法 在第1行的'mysqldump --triggers --routines -u root -p mydb> mydb_20120924.dmp'附近
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mysqldump --triggers --routines -u root -p mydb > mydb_20120924.dmp' at line 1
推荐答案
您似乎正在尝试从mysql命令行解释器内部运行mysqldump命令.
It looks like you are trying to run the mysqldump command from inside the mysql command line interpreter.
mysqldump命令的提示符是否显示'mysql>'?然后,您正在运行mysql命令行解释器.应该使用它-实际上,它只能用于-运行mysql命令.
Does the prompt for the mysqldump command say 'mysql> '? Then you are running the mysql command line interpreter. It should be used - indeed, it can only be used - for running mysql commands.
mysqldump是一个单独的命令,必须从shell运行.
mysqldump is a separate command and must be run from the shell.
通过键入"exit"退出mysql-您将看到一个shell提示.然后mysqldump命令将起作用.
Quit mysql by typing "exit" - you will see a shell prompt. Then the mysqldump command will work.
这篇关于在MySQL中转储数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!