Reputation: 343
I want to backup my database. So I've used this command
$command = "mysqldump --user=root asset_management > D:\assetmanagement\public\backup\backup.sql";
system($command);
But this will produce an empty sql file.. can anyone help?
Upvotes: 1
Views: 1502
Reputation: 11
$command = "mysqldump --user=root -pass=yourpassword asset_management > D:\assetmanagement\public\backup\backup.sql"; system($command);
Upvotes: 1
Reputation: 11
Suppose your mysqldump is in the C:/wamp/bin/mysql/mysql5.1.33/bin/ folder
$mysqlPath="C:/wamp/bin/mysql/mysql5.1.33/bin/";
//There should be password for root user. Blank password will not work.
$command = $mysqlPath . "mysqldump.exe asset_management > D:\assetmanagement\public\backup\backup.sql --user=root --password=yourpassword ";
Upvotes: 1