Jonathan Stellwag
Jonathan Stellwag

Reputation: 4287

MySqlDump - Empty dump by using Windows

Tried out the mysqldump exe to get a local dump. Worked fine on MAC_OS. Just at windows i get a exit-code 1 and a local empty .sql file.

I used following code:

$command = ''.$locationDumpExe.' --user='.$dbuser.' --password='.$dbpassword.' --no-data --host=localhost  '.$dbname.' > '.$dumpfile.'';

exec($command,$output,$return_var);

The variables had been set like the following:

The return_var returns 1

The test_db has an amount of 90 - 100 tables and is filled with ~ 50 - 100 datasets. Maybe this is the issue?

As I said on Mac_OS the dump works fine but for good reasons I also have to use the dump functionality on Windows.

Thanks in advance for your help.

Upvotes: 4

Views: 996

Answers (1)

Suman EStatic
Suman EStatic

Reputation: 81

when you try with windows you have to specify the full path of mysqldump.exe

C:/wamp/bin/mysql/mysql5.6.17/bin/mysqldump.exe -h {hostname} -u {usernamne} -p{password} {dbName} > path/to/store/sql/file.

Hope this helps. Thanks Suman W.

Upvotes: 3

Related Questions