Activate a plugin via a SQL query

If your goal is automated plugin activation you don’t have to do it via SQL. You could, of course, but why not use functionality that comes with WordPress?

As I mentioned in my comment, the data has been serialized so you just have to

  • unserialize the data,
  • add your plugin,
  • re-serialize the data,
  • and update the option.

Here is a code snippet for that:

$active_plugins = unserialize(get_option('active_plugins'));
if ($active_plugins && is_array($active_plugins)) {
    $active_plugins[] = 'PLUGIN-DIR/PLUGIN-FILE.php'; // as in 'akismet/akismet.php'
    update_option('active_plugins', serialize($active_plugins));
} else {
    // something went wrong...
}

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)