Issue
I have this command line which already runs into a cpanel hosting:
mysql -hlocalhost -e "use xxx_xx; update xxx_jshopping_manufacturers set manufacturer_publish = 0 where \`name_es-ES\` NOT IN ('BULL SOUND', 'ROYAL', 'BLACK + DECKER (ELECTROD)', 'SAMSUNG', 'DAEWOO', 'OSTER', 'WAHL', 'REMINGTON', 'BROTHER', 'CORELLE', 'SINGER', 'PANASONIC', 'FRIGIDAIRE', 'LG', 'PHILIPS ELECTRONICA', 'PIONEER', 'SONY', 'MOTOROLA', 'DEWALT', 'APPLE', 'JVC', 'MAXELL', 'WELL', 'STANLEY', 'LASKO', 'WESTINGHOUSE', 'CATA', 'FARBERWARE', 'BLACK & DECKER (HERRAM)', 'PHILIPS', 'BLAUPUNKT', 'RAYOVAC', 'BLU', 'JBL', 'BLACK & DECKER (HERRAM)','MUEBLES', 'ALTEC', 'SMART BALANCE', 'NEWLINK', 'YEZZ', 'HUAWEI', 'FORD', 'WINDMERE','DRIJA','REAL SALOON','INGCO'); select count(product_id)as '--- Product quantity ---' from xxx_jshopping_products; select \`name_es-ES\` as '--- Brands that are hidden ---' from xxx_jshopping_manufacturers where manufacturer_publish = 0;" | mailx -r [email protected] -s 'your site has been updated' [email protected] [email protected]
This command runs a query in mysql DB to hide some items and then email the results, it worked all time without issues until now that I have to move this site to a Centos / plesk hosting, I have made changes to the script to include user and password and it runs as always by clicking on the "Run now" button on the plesk scheduled task panel, however, when I click the "Ok" button to save the cron, it is given me this error
Error: Incorrect parameter values. cmd: The command cannot be longer than 980 characters.
Is there a way to get rid of that limit?
Solution
It is possible without addressing the maximum length issue.
Create a script file like this and it will run.
mysql -h hostname -otherParametersAsNeeded <<EOF1
use xxx_xx;
update xxx_database set ...
...
EOF1
Answered By - Natarajan N Napoleon Answer Checked By - Gilberto Lyons (WPSolving Admin)