CnV
CnV

Reputation: 391

Exported Database is Empty

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

Answers (2)

trojan
trojan

Reputation: 1535

mysqldump -u root -p[root_password] [database_name] > dumpfilename.sql

it looks like you forgetting to type the password

Upvotes: 0

Len_D
Len_D

Reputation: 1420

Remove the space between -p and the password.

$command = "mysqldump -u root -pvti_ctes_demo > db/backupfile.sql";

Upvotes: 1

Related Questions