system and mysqldump in winxp

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
tores
Forum Contributor
Posts: 120
Joined: Fri Jun 18, 2004 3:04 am

system and mysqldump in winxp

Post by tores »

Hi

I can't seem to get the following database-backup command to work...

Code: Select all

$last_line = system('"C:\\Program Files\\MySQL\\MySQL Server 4.1\\bin\\mysqldump.exe" -u[user] -p[pass] [db_name] > C:\\Program Files\\MySQL\\MySQL Server 4.1\\backup\\27_07_2005_backup.sql', $result);
I've tried with all sorts of combinations with double quotes and one(DIRECTORY_SEPARATOR) or two backslashes.
But all I get is either:

Code: Select all

C:\Program Files\MySQL\MySQL Server 4.1\bin\mysqldump.exe: Got error: 1103: Incorrect table name 'Files\MySQL\MySQL' when doing LOCK TABLES
with the statement above (which I presume is the closest to being correct) or

Code: Select all

'C:\Program' is not recognized as an internal or external command, operable program or batch file.
with other combinations of double quotes and backslashes...

Any suggestion is appreciated...

regards tores
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

Post by anjanesh »

Have you tried using the short file names (DOS type - 12 chars max) like
C:\\PROGRA~1\\etc ?
tores
Forum Contributor
Posts: 120
Joined: Fri Jun 18, 2004 3:04 am

Post by tores »

Swithed to short names and now it's working. Thanks a bunch :D

regards tores
Post Reply