第一次使用mysql备份数据库mydb是出现如下错误。麻烦帮忙。。谢谢!!
mysql> mysqldump -hlocalhost -uroot -p123 mydb -A -R>c:/test.txt;
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 -hlocalhost -uroot -p123 framework -A -R>c:/test.txt' at line 1

解决方案 »

  1.   

    mysqldump -u 用户名 -p 数据库名 > 导出的文件名   
     mysqldump -u wcnc -p smgp_apps_wcnc > wcnc.sql
      

  2.   

    还是报这个错是不是版本问题? 不明白继续求教。。
    check the manual that corresponds to your MySQL server version for the right syntax to use near 
      

  3.   

    你是否是在MYSQL的命令行下?
    运行->CMD->进入MYSQL目录->CD BIN->
    mysqldump -uroot -p 数据库名> D:\TEMP\wcnc.sql
      

  4.   

    是的。。mysql> mysqldump -u root -p 123 mydb>dbback.sql;
      

  5.   

    mysqldump -uroot -p mydb>dbback.sql
      

  6.   

    在MYSQL5.1下没有问题,你的版本
      

  7.   

    Server version: 6.0.0-alpha-community-nt-debug MySQL Community Server (GPL)
      

  8.   

    代码贴出来看看
    mysqldump -uroot -p mydb>dbback.sql
      

  9.   

    # mysqldump -u root -p123 mydb>dbback.sql这是操作系统命令,不是在mysql>命令行中使用的。
    直接在操作系统下运行下试试。
      

  10.   

    mysql> mysqldump -uroot -p  mydb>dbback.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 'mysq
    dump -uroot -p  mydb>dbback.sql' at line 1
    mysql>
      

  11.   

    已经说过,先启动MYSQL,
    开始->运行->CMD->进入MYSQL目录->CD BIN->
    mysqldump -uroot -p 数据库名> D:\TEMP\wcnc.sql
      

  12.   

    出现新问题。。谢谢。
    C:\Program Files\MySQL\MySQL Server 6.0\bin>mysqldump -u root -p  mydb>c:\mydb.s
    ql;
    Enter password: ***
    mysqldump: Got error: 1049: Unknown database 'mydb;' when selecting the database
      

  13.   

    mydb:修改为你的数据库名,用
    SHOW CREATE DATABASE 
    显示
      

  14.   

    mydb正是我要备份的。。mysql> show databases;
    +--------------------+
    | Database           |
    +--------------------+
    | information_schema |
    | itcast             |
    | jeecms_2_1_0_beta  |
    | localdb            |
    | mydb               |
    | mysql              |
    +--------------------+
      

  15.   

    mysqldump -uroot -p mydb>c:\mydb.sql 
      

  16.   

    哈哈成功。。感激不尽!!mysqldump -uroot -pmydb>c:\mydb.sql