skip to Main Content

Using the command line on windows. Mysqldump does not accept the "" in the path name for the –tab= option.

I have tried the following:
mysqldump -u root -p --tab=D:DataDump myDB
mysqldump -u root -p --tab="D:DataDump" myDB
mysqldump -u root -p --tab='D:DataDump' myDB
mysqldump -u root -p --tab=D:\DataDump myDB

I get either a syntax error or ERROR Unknown command D

2

Answers


    1. Use Short File Names
    2. Use Proximity Paths: If your path contains spaces and you still want to use the –tab option, you can try using the old DOS-style proximity path notation. Instead of using double quotes, you can use the ~ character followed by the directory’s short name.
    3. Try renaming the folder.
    Login or Signup to reply.
  1. Using the command line on windows. Mysqldump does not accept the "" in
    the path name for the –tab= option

    In fact it does accept.

    Running the following command in windows.

    C:Program FilesMySQLMySQL Server 8.0bin>mysqldump -u root -p --tab="C:ProgramDataMySQLMySQL Server 8.0Uploads" world
    Enter password: *********
    
    C:Program FilesMySQLMySQL Server 8.0bin>
    

    Generates the following files in the Uploads directory ,

    enter image description here

    Some of the content of the country.txt

    ABW Aruba   North America   Caribbean   193.00  N  103000  78.4    828.00  793.00  Aruba   Nonmetropolitan Territory of The Netherlands    Beatrix 129 AW
    AFG Afghanistan Asia    Southern and Central Asia   652090.00   1919    22720000    45.9    5976.00 N  Afganistan/Afqanestan   Islamic Emirate Mohammad Omar   1   AF
    AGO Angola  Africa  Central Africa  1246700.00  1975    12878000    38.3    6648.00 7984.00 Angola  Republic    José Eduardo dos Santos 56  AO
    AIA Anguilla    North America   Caribbean   96.00   N  8000    76.1    63.20   N  Anguilla    Dependent Territory of the UK   Elisabeth II    62  AI
    ALB Albania Europe  Southern Europe 28748.00    1912    3401200 71.6    3205.00 2500.00 Shqipëria   Republic    Rexhep Mejdani  34  AL
    AND Andorra Europe  Southern Europe 468.00  1278    78000   83.5    1630.00 N  Andorra Parliamentary Coprincipality        55  AD
    ANT Netherlands Antilles    North America   Caribbean   800.00  N  217000  74.7    1941.00 N  Nederlandse Antillen    Nonmetropolitan Territory of The Netherlands    Beatrix 33  AN
    ARE United Arab Emirates    Asia    Middle East 83600.00    1971    2441000 74.1    37966.00    36846.00    Al-Imarat al-´Arabiya al-Muttahida  Emirate Federation  Zayid bin Sultan al-Nahayan 65  AE
    

    Note. I used the Uploads directory because of the secure_file_priv, mysql needs permitions to that directory.

    mysql> SHOW VARIABLES LIKE "secure_file_priv";
    +------------------+------------------------------------------------+
    | Variable_name    | Value                                          |
    +------------------+------------------------------------------------+
    | secure_file_priv | C:ProgramDataMySQLMySQL Server 8.0Uploads |
    +------------------+------------------------------------------------+
    1 row in set (0.00 sec)
    

    See more on mysqldump — A Database Backup Program

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search