How to search for string in Drupal database and replace I am wondering what would be the safest way to search through the mysql database for a specific keyword and update. 

More specifically here is what I am trying to do. 

In many of the nodes we have videos embedded. Unfortunately, we didn't add preload="none" to our videos. Now the pages take a long time to fully load plus they download the whole video without the user clicking on it wasting bandwidth. 

I want to search the nodes (mainly the body field) for:
video controls=""
and replace with 
video controls="controls" preload="none"

I assume I can use something like this? update [table_name] set [field_name] = replace([field_name],'[string_to_find]','[string_to_replace]');

Which table should I search? 

I don't want to mess up the database so a second opinion is highly appreciated.
You don't say which version of Drupal you are using.  If it's D7, there is the scanner module which can probably do what you want.

If it is D8, I'd suggest writing a drush script to update the content.  The standardization of entities and methods makes that fairly easy. Here's a snippet of code from a script I used to grab all text from our site that needed to be translated.  You can modify it to do what you need.

use \Drupal\node\Entity\Node;
use Drupal\Core\Entity\EntityInterface;

$entity_type = 'node';
$bundle = 'article;
$fields = [
  'field_header' =&gt; 'paragraph',
  'field_summary' =&gt; 'text',
];

$entities = gen_i18n_get_entities($entity_type, $bundle);
foreach ( $entities as $vid =&gt; $id ) {
  $entity = \Drupal::entityTypeManager()-&gt;getStorage($entity_type)-&gt;load($id);

  gen_i18n_parse_entity($entity, $fields, $page);
}

/**
 * Find the entity ids for the specified type and bundle.
 *
 * @param string $entity_type
 * @param string $bundle
 * @return array
 */
function gen_i18n_get_entities( $entity_type, $bundle ) {
  $query = \Drupal::entityQuery($entity_type)
    -&gt;condition('type', $bundle);
  if ( $entity_type == 'node' ) {
    $query-&gt;condition('status', 1);
  }
  $results = $query-&gt;execute();
  return $results;
}
/**
 * Walk thru the entity fields to get required information.
 *
 * @param EntityInterface $entity
 * @param array $fields
 * @param array $page
 */
function gen_i18n_parse_entity( EntityInterface $entity, array $fields, array &amp;$page ) {
  global $field_num;

  $field_num = 0;
  foreach( $fields as $field =&gt; $field_type ) {
    if ( !in_array($field_type, array('alias', 'menu'))) {
      $field_def = $entity-&gt;getFieldDefinition($field);
      if ( $field_def != NULL ) {
        $label = $field_def-&gt;getLabel();
      }
      else {
        print "** Could not find field {$field} in {$entity-&gt;bundle()} {$entity-&gt;id()}\n";
        continue;
      }
    }
    else {
      $label = $field_type;
    }
    switch ( $field_type ) {
      case 'text':
        gen_i18n_parse_text( $entity, $field, $page, $label);
        break;
      case 'paragraph':
        gen_i18n_parse_paragraph($entity, $field, $page, $label);
        break;
      case 'metatags':
        gen_i18n_parse_metatags( $entity, $field, $page, $label);
        break;
      case 'alias':
        $field_num++;
        $page['en']["{$field_num} - URL"] =  $entity-&gt;toURL()-&gt;toString();
        break;
      case 'menu':
        gen_i18n_parse_menu($entity, $field, $page);
        break;

    }
  }
}