Reputation: 391
I have a code to backup my database by using mysqldump
. However, the output is a file with blank data inside. Below is the script.
$command = "mysqldump -u root -p vti_ctes_demo > db/backupfile.sql";
system($command);
Upvotes: 0
Views: 95
Reputation: 1535
mysqldump -u root -p[root_password] [database_name] > dumpfilename.sql
it looks like you forgetting to type the password
Upvotes: 0
Reputation: 1420
Remove the space between -p and the password.
$command = "mysqldump -u root -pvti_ctes_demo > db/backupfile.sql";
Upvotes: 1