How to disable and enable all contributed modules in Mysql?
It is not necessary to disable all contrib modules during a minor update of Drupal.  If you are planning on exporting and importing your database anyway, I would recommend using Drush to do the update on a local development copy of your site.  That way, you can test the result of the update before moving it back to the live site.  It is not advisable to update your live site directly.

You might also want to give serious consideration to finding a better hosting service.  If you had ssh access, you could migrate your database from live to dev with drush sql-sync, which is a great time-saver.

Edit: If you do want to disable all of your modules via Drush, here is a shell alias that will do it (from examples/example.drushrc.php in Drush-5):

# $options['shell-aliases']['dis-all'] = '!drush -y dis $(drush pml --status=enabled --type=module --no-core --pipe)';


If you want to enable all of the contrib modules from the live site on the dev site, you could do something like this:

drush @dev -y en $(drush @live pml --status=enabled --type=module --no-core --pipe)


I don't recommend disabling modules by manipulating the SQL directly; it's much more reliable to use Drush.