官术网_书友最值得收藏!

Using INSTALL SONAME

The INSTALL SONAME command is used to install plugins in MariaDB. In this recipe, we'll install the Cassandra storage engine.

How to do it...

  1. Connect to MariaDB using the mysql command-line client with a user that has the INSERT privilege on the mysql.plugins table. The root user has this privilege, but other users might as well.
  2. Install the Cassandra storage engine plugin using the following command line:
    INSTALL SONAME 'ha_cassandra';
    
  3. Issue the SHOW plugins; command and look for the following text:
    | CASSANDRA | ACTIVE | STORAGE ENGINE | ha_cassandra.so | GPL | 
    
  4. Next, issue the SHOW STORAGE ENGINES; command and look for the following text:
    | CASSANDRA | YES | Cassandra storage engine| NO | NO | NO | 
    
  5. The preceding output indicates that the Cassandra storage engine is installed and ready to go. The three NO columns are about transactions, distributed XA transactions, and savepoints, respectively. All three are features that the Cassandra storage engine does not support.

How it works...

When this command is run, the server looks in the configured plugin directory and loads the plugin with that name. We do not need to specify the file extension. The actual name of the ha_cassandra file will either be ha_cassandra.dll or ha_cassandra.so on Windows and Linux respectively.

There's more...

Installing plugins is not very difficult in MariaDB but there are some things that can trip us up if we're not careful.

Plugin names versus filenames

The name of a given plugin is defined in the data structures inside the plugin. The filename is the name of the file that contains the plugin. The two are similar, but they are not the same. For example, the name of the Cassandra storage engine plugin is CASSANDRA and the filename is ha_cassandra.so. The name is case insensitive, so when referring to it we can use CASSANDRA, Cassandra, cassandra, or even CaSsAnDrA if we want. The filename, on the other hand, is case sensitive if our underlying filesystem is case sensitive.

INSTALL SONAME versus INSTALL PLUGIN

The INSTALL SONAME command is just a variation of the INSTALL PLUGIN command. The main difference is that INSTALL PLUGIN requires two sets of information, the name and the filename, and INSTALL SONAME just needs the filename. The filename must be quoted. Here is the recipe using INSTALL PLUGIN:

INSTALL PLUGIN Cassandra SONAME 'ha_cassandra';

Apart from being shorter, INSTALL SONAME is no different from INSTALL PLUGIN, functionality-wise.

See also

主站蜘蛛池模板: 太仆寺旗| 临桂县| 射洪县| 中阳县| 玉树县| 徐汇区| 永德县| 安平县| 思茅市| 淄博市| 耒阳市| 霞浦县| 聂荣县| 泸溪县| 抚远县| 通海县| 阿克| 清远市| 玉环县| 和平县| 延长县| 龙江县| 新蔡县| 河南省| 桃源县| 灵山县| 松潘县| 积石山| 天门市| 射阳县| 逊克县| 福海县| 绵竹市| 闻喜县| 剑阁县| 南宫市| 宁明县| 西峡县| 彝良县| 黔南| 信宜市|