Drupal - How do I change the temporary directory without using any administrative pages provided by Drupal?

In Drupal 7 the temporary path is stored in the variable file_temporary_path, so you can either update the entry in the variables table with a SQL-query. Or you can use Drush:

drush vset file_temporary_path [some_new_path].

Variables can be overwritten within settings.php. An entry like the following will do it in D7:

$conf['file_temporary_path'] = '/tmp';

Replace '/tmp' with your specific path. You might also need to set the variable file_private_path.

For Drupal 8 using Drush it's:

drush config-set system.file path.temporary /tmp