首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > Mysql >

mysql 导出数据,该如何处理

2012-09-11 
mysql 导出数据mysql mysql dump -uroot -p yqfx outfile.sqlERROR 1064 (42000): You have an error

mysql 导出数据
mysql> mysql dump -uroot -p yqfx > outfile.sql;
ERROR 1064 (42000): 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 'mysql
 dump -uroot -p yqfx > outfile.sql' at line 1

yqfx是要导出的数据库,-p后加上密码也是如此,包括用 source命令是也总提示SQL语句错误,请问是怎么回事呀,
我是刚开始学,谢了!

[解决办法]
不是在MySQL命令行里面执行mysqldump。
mysqldump 在 shell 下面直接执行(系统里面直接执行)。
mysqldump -uroot -p yqfx > outfile.sql;


source 进入数据库命令行后执行,但是文件必须在当前目录。

热点排行