In addition to what acrosman said, you can also use the -e switch to pass SQL from the command line.
$sql = "....."; system("mysql -u root -pxxxx db_name -e \"$sql\"");
In addition, I hope that you are not actually connecting to the database as root from a PHP application.
tj111 source share