Export and import all Plugin options

The Codex suggests that you use wp_load_alloptions instead.

I would suggest that you therefore use wp_load_alloptions. That technically answers the question, I think.

wp_load_alloptions will pull all of the options out of the options table and your question does not explain why you need to do that. Are you actually needing to pull only your my_plugin_* options, because that would be a different answer? If so, there is no “get options by wildcard” function that I know of, but it isn’t hard to construct.

function get_options_by_wildcard($prefix = '') {
  if (empty($prefix)) return false;
  global $wpdb;
  $ret = array();
  $options = $wpdb->get_results(
    $wpdb->prepare("SELECT option_name,option_value FROM {$wpdb->options} WHERE option_name LIKE %s",$prefix.'%'),
    ARRAY_A
  );
  if (!empty($options)) {
    foreach ($options as $v) {
      $ret[$v['option_name']] = maybe_unserialize($v['option_value']);
    }
  }
  return (!empty($ret)) ? $ret : false;
}
var_dump(get_options_by_wildcard('my_plugin_'));

Your plugin should “know” what its one options are so you should be able to do it by looping through the plugin options without needing another query. For example, assuming your plugin is a class and your available plugin options are stored in the class variable plugin_options:

function get_my_plugin_options() {
  $ret = array();
  foreach ($this->plugin_options as $v) {
    $ret[$v] = get_option($v);
  }
  return $ret;
}
var_dump(get_my_plugin_options());

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