MariaDB:如何在Arch Linux上将OQGRAPH作为DB引擎安装

时间:2018-12-15 02:39:37

标签: database mariadb archlinux directed-acyclic-graphs

是否可以在Arch Linux上为MariaDB安装OQGRAPH?如果可以,怎么办?

这是我当前安装的引擎:

MariaDB [(none)]> show engines;
+--------------------+---------+--------------------------------------------------------------------------------------------------+--------------+------+------------+
| Engine             | Support | Comment                                                                                          | Transactions | XA   | Savepoints |
+--------------------+---------+--------------------------------------------------------------------------------------------------+--------------+------+------------+
| MEMORY             | YES     | Hash based, stored in memory, useful for temporary tables                                        | NO           | NO   | NO         |
| MRG_MyISAM         | YES     | Collection of identical MyISAM tables                                                            | NO           | NO   | NO         |
| CSV                | YES     | Stores tables as CSV files                                                                       | NO           | NO   | NO         |
| BLACKHOLE          | YES     | /dev/null storage engine (anything you write to it disappears)                                   | NO           | NO   | NO         |
| MyISAM             | YES     | Non-transactional engine with good performance and small data footprint                          | NO           | NO   | NO         |
| ARCHIVE            | YES     | gzip-compresses tables for a low storage footprint                                               | NO           | NO   | NO         |
| Aria               | YES     | Crash-safe tables with MyISAM heritage                                                           | NO           | NO   | NO         |
| InnoDB             | DEFAULT | Percona-XtraDB, Supports transactions, row-level locking, foreign keys and encryption for tables | YES          | YES  | YES        |
| PERFORMANCE_SCHEMA | YES     | Performance Schema                                                                               | NO           | NO   | NO         |
| SEQUENCE           | YES     | Generated tables filled with sequential values                                                   | YES          | NO   | YES        |
+--------------------+---------+--------------------------------------------------------------------------------------------------+--------------+------+------------+
10 rows in set (0.00 sec)

按照我发现要安装oqgraph的说明,这是我的结果:

MariaDB [(none)]> install plugin oqgraph soname 'ha_oqgraph.so';

ERROR 1126 (HY000): Can't open shared library '/usr/lib/mysql/plugin/ha_oqgraph.so' (errno: 2, cannot open shared object file: No such file or directory)

该文件不存在:

ls /usr/lib/mysql/plugin/ha_oqgraph.so
ls: cannot access '/usr/lib/mysql/plugin/ha_oqgraph.so': No such file or directory

这两个都不返回结果:

pacman -Ss oqgraph
pacman -Ss "open query graph"

相关页面:

Arch Wiki页面上未提及OQGraph:
https://wiki.archlinux.org/index.php/MySQL

No OQGraph in my MariaDB?
接受的解决方案对我不起作用。

https://mariadb.com/kb/en/library/installing-oqgraph/
该页面未提供Arch Linux解决方案

1 个答案:

答案 0 :(得分:0)

这是一种解决方法,而不是理想的解决方案。但是,它有效。

将下载的库版本与已安装的MariaDB版本进行匹配。

下载libJudy.so.1。我在Arch仓库中找不到libJudy。我使用了http://ftp.br.debian.org/debian/pool/main/j/judy/libjudydebian1_1.0.5-5_amd64.deb。然后按照以下步骤安装lib。

extract libJudy.so.1.0.3
cd /lib
sudo mv libJudy.so.1.0.3 .
sudo ln -s libJudy.so.1.0.3 libJudy.so.1
sudo chmod 644 libJudy.so.1.0.3

接下来,您需要ha_oqgraph.so。我下载了MariaDB的完整官方tarball以获取该文件,并将该版本与从Arch存储库中安装的MariaDB的版本匹配。

extract ha_oqgraph.so
sudo mv ha_oqgraph.so /usr/lib/mysql/plugin/ha_oqgraph.so
sudo chmod 755 /usr/lib/mysql/plugin/ha_oqgraph.so

以root用户身份登录MariaDB并运行:

MariaDB > install plugin oqgraph soname 'ha_oqgraph.so';
Query OK, 0 rows affected (0.00 sec)

然后运行此命令以确认OQGRAPH已安装:

MariaDB > show engines;

这是我的结果:

+--------------------+---------+--------------------------------------------------------------------------------------------------+--------------+------+------------+
| Engine             | Support | Comment                                                                                          | Transactions | XA   | Savepoints |
+--------------------+---------+--------------------------------------------------------------------------------------------------+--------------+------+------------+
| MEMORY             | YES     | Hash based, stored in memory, useful for temporary tables                                        | NO           | NO   | NO         |
| MRG_MyISAM         | YES     | Collection of identical MyISAM tables                                                            | NO           | NO   | NO         |
| CSV                | YES     | Stores tables as CSV files                                                                       | NO           | NO   | NO         |
| BLACKHOLE          | YES     | /dev/null storage engine (anything you write to it disappears)                                   | NO           | NO   | NO         |
| MyISAM             | YES     | Non-transactional engine with good performance and small data footprint                          | NO           | NO   | NO         |
| ARCHIVE            | YES     | gzip-compresses tables for a low storage footprint                                               | NO           | NO   | NO         |
| Aria               | YES     | Crash-safe tables with MyISAM heritage                                                           | NO           | NO   | NO         |
| InnoDB             | DEFAULT | Percona-XtraDB, Supports transactions, row-level locking, foreign keys and encryption for tables | YES          | YES  | YES        |
| PERFORMANCE_SCHEMA | YES     | Performance Schema                                                                               | NO           | NO   | NO         |
| OQGRAPH            | YES     | Open Query Graph Computation Engine (http://openquery.com/graph)                                 | NO           | NO   | NO         |
| SEQUENCE           | YES     | Generated tables filled with sequential values                                                   | YES          | NO   | YES        |
+--------------------+---------+--------------------------------------------------------------------------------------------------+--------------+------+------------+
11 rows in set (0.02 sec)