I have tried the following to copy the files in Data to another location but received the error "invalid parameters." What is wrong with my command?

C:\xcopy c:\ProgramData\MySQL\MySQL Server 5.7\Data c:\DataBackUp

I have Windows 10.


Your source folder needs to be enclosed in double-quotes like this:

C:\xcopy "c:\ProgramData\MySQL\MySQL Server 5.7\Data" c:\DataBackUp

Otherwise the XCOPY command sees the following as separate parameters:

  • c:\ProgramData\MySQL\MySQL Server
  • 5.7\Data
  • c:\DataBackUp

It expects two paths, not three, hence the "Invalid parameters" error.

As a side note, it's only necessary to specify a path to XCOPY (e.g. C:\xcopy) if you really have a copy of the executable in the root of C: and intend to execute it from there. If not, just start your command with XCOPY.

  • Tks. But, now I get this message : Does C:\DataBackUp specify a file name or directory name on target (F=file, D=directory)? and I just typed D. And then a bunch of lines came out. What should I do to ensure all the files in Data get copied into the DataBackUp folder? Will windows 10 recognise that is a folder? – Karen Goh Oct 16 '18 at 2:42
  • 1
    @KarenGoh add a back slash to the end of the destination path to tell XCOPY it's a folder, like this c:\DataBackUp\ – I say Reinstate Monica Oct 16 '18 at 2:43
  • Now, I have this SQLTable -hi5 and other tables inside but it is not copied. And these are the things that I really make a copy. How come Windows do not copy all these files into my DataBackUp and only copied otheres like ibdata1? – Karen Goh Oct 16 '18 at 2:54
  • 1
    @KarenGoh This sounds like you're facing a different problem. On this site we ask one question per problem, so please post a new question. – I say Reinstate Monica Oct 16 '18 at 2:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.