Bug #52499 | mysql.exe -e "source filename" fails for some file names | ||
---|---|---|---|
Submitted: | 31 Mar 2010 12:10 | Modified: | 1 Apr 2010 8:49 |
Reporter: | Ravi Thati | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: Command-line Clients | Severity: | S2 (Serious) |
Version: | any latest version (tried on 5.1.45 also | OS: | Windows (windows 2003/3008R2) |
Assigned to: | CPU Architecture: | Any | |
Tags: | restore logs, source options |
[31 Mar 2010 12:10]
Ravi Thati
[31 Mar 2010 12:56]
MySQL Verification Team
Please try: mysql -u root -p -e "source C:/dumps/gotcha.sql" using / instead of \ Thanks in advance.
[31 Mar 2010 13:07]
Ravi Thati
Thank you Miguel Solorzano. That does the trick. But why is that Windows slash giving the error ?
[31 Mar 2010 13:09]
Ravi Thati
And what is special about character 'g' and windows slash?
[31 Mar 2010 13:21]
Valeriy Kravchuk
Please, check the manual, http://dev.mysql.com/doc/refman/5.0/en/mysql-commands.html: "source file_name, \. file_name Read the named file and executes the statements contained therein. On Windows, you can specify path name separators as / or \\." So, please, check if you'll get the same problem with the same filename starting with 'g', but with '/' or '\\' in full pathname, like this: mysql.exe -u root -ppwd -e"source c:/dumps/gotcha.sql" or this: mysql.exe -u root -ppwd -e"source c:\\dumps\\gotcha.sql"
[31 Mar 2010 13:49]
Ravi Thati
with UNIX style separator it works : mysql -u root -p -e "source C:/dumps/gotcha.sql" double slash gives the following error C:\dumps>mysql -u root -ppwd -e "source C:\\dumps\\gotcha.sql" ERROR at line 1: Unknown command '\\'.
[1 Apr 2010 8:06]
Sveta Smirnova
Thank you for the feedback. Closing as "Not a Bug" because last comment.
[1 Apr 2010 8:49]
Ravi Thati
Hi Sveta, I am not happy to use UNIX style separator and want to use Windows one only. And nobody have not suggested a fix for file starting with 'g' when using Windows separators. An alternate way of doing is suggested and i am agreed for that. But what about the actual problem??