Reputation: 1636
Going nuts. I don't find this exact line and using the example at the reference from MySQL, I'm obviously crossed-eyed here!
This is the wrong syntax but I'm not sure where to put the option --ignore-table=search_index and have tried many variations except the right one!
$cmd = "mysqldump -u --ignore-table=search_index " . $prod_db_user . " -p" . $prod_db_pass . " " . $prod_db_1 . " > " . $qa_backup_name;
I'm just trying to dump the database and exclude a table that is named search_index.
Thanks
Upvotes: 1
Views: 735
Reputation: 270775
Place the $prod_db_user
username after -u
, as that is the username flag.
$cmd = "mysqldump -u{$prod_db_user} --ignore-table=search_index -p{$prod_db_pass} $prod_db_1 > $qa_backup_name";
Since this is a double-quoted string, all the PHP variables can go directly into the string. However, be sure to escape them with escapeshellarg()
first!.
$prod_db_user = escapeshellarg($prod_db_user);
$prod_db_pass = escapeshellarg($prod_db_pass);
// etc...
Finally, depending on the execution environment, it may be necessary to specify the full path to mysqldump
(if it isn't otherwise found in the $PATH
(or %PATH%
) environment variable.
$cmd = "/path/to/mysqldump -u{$prod_db_user} ....";
Upvotes: 1