InstallMySQLMariaDBversion10.0.10withCONNECTandOQGRAPHENGINEonCentOS6.5minimal... MariaDB
LocationSkySQLSpain
I needed to test the new SkySQL server audit plug-in 1.1.7 on latest MariaDB 10.0.10
More info about that handy plug in you may find here: http://www.skysql.com/downloads/mariadb-audit-plugin
Take a moment to read the info, along with that nice blog: http://www.skysql.com/blogs/ralf-gebhardt/activating-auditing-mariadb-an...
Then I decided to test the CONNECT engine install as I have a friend who needs to import unknown DB data exported into XML.
And I was interested to import the Skype sqlite3 database into MySQL ...:)
More about that MariaDB engine you may find here: https://mariadb.com/kb/en/connect/
So.
The test was done on CentOS 6.5 minimal install.
I will go step by step from the start.
1. Configure the MariaDB repository for CentOS 6.5, the best way to do it the MariaDB repository configuration tool:
Https://downloads.mariadb.org/mariadb/repositories/
Check the CentOS link, then choose the release, in my case CentOS 6 (64 bit), then the MariaDB version: 10.0
As a direct link:
Https://downloads.mariadb.org/mariadb/repositories/#mirror=nucleus&distr...
In short: the content of the MariaDB. repo shocould be as follows:
cat /etc/yum.repos.d/MariaDB.repo # MariaDB 10.0 CentOS repository list - created 2014-05-05 10:31 UTC# http://mariadb.org/mariadb/repositories/[mariadb]name = MariaDBbaseurl = http://yum.mariadb.org/10.0/centos6-amd64gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDBgpgcheck=1
1. Install the MariaDB 10.0.10:
root@centos-6.5-minimal:[Mon May 05 12:49:52][~]$ yum search MariadbLoaded plugins: fastestmirrorLoading mirror speeds from cached hostfile * base: sunsite.rediris.es * extras: sunsite.rediris.es * updates: sunsite.rediris.es================================= N/S Matched: Mariadb ==============================MariaDB-Galera-server.x86_64 : MariaDB: a very fast and robust SQL database serverMariaDB-cassandra-engine.x86_64 : MariaDB: a very fast and robust SQL database serverMariaDB-client.x86_64 : MariaDB: a very fast and robust SQL database serverMariaDB-common.x86_64 : MariaDB: a very fast and robust SQL database serverMariaDB-compat.x86_64 : MariaDB: a very fast and robust SQL database serverMariaDB-connect-engine.x86_64 : MariaDB: a very fast and robust SQL database serverMariaDB-devel.x86_64 : MariaDB: a very fast and robust SQL database serverMariaDB-oqgraph-engine.x86_64 : MariaDB: a very fast and robust SQL database serverMariaDB-server.x86_64 : MariaDB: a very fast and robust SQL database serverMariaDB-shared.x86_64 : MariaDB: a very fast and robust SQL database serverMariaDB-test.x86_64 : MariaDB: a very fast and robust SQL database serverName and summary matches only, use "search all" for everything.root@centos-6.5-minimal:[Mon May 05 12:51:17][~]$ yum install MariaDB-server MariaDB*engine MariaDB-client Loaded plugins: fastestmirrorLoading mirror speeds from cached hostfile * base: mirrors.atosworldline.com * extras: sunsite.rediris.es * updates: sunsite.rediris.esSetting up Install ProcessResolving Dependencies--> Running transaction check---> Package MariaDB-cassandra-engine.x86_64 0:10.0.10-1.el6 will be installed---> Package MariaDB-client.x86_64 0:10.0.10-1.el6 will be installed--> Processing Dependency: MariaDB-common for package: MariaDB-client-10.0.10-1.el6.x86_64---> Package MariaDB-connect-engine.x86_64 0:10.0.10-1.el6 will be installed--> Processing Dependency: libodbc.so.2()(64bit) for package: MariaDB-connect-engine-10.0.10-1.el6.x86_64---> Package MariaDB-oqgraph-engine.x86_64 0:10.0.10-1.el6 will be installed--> Processing Dependency: libJudy.so.1()(64bit) for package: MariaDB-oqgraph-engine-10.0.10-1.el6.x86_64---> Package MariaDB-server.x86_64 0:10.0.10-1.el6 will be installed--> Processing Dependency: perl(DBI) for package: MariaDB-server-10.0.10-1.el6.x86_64--> Running transaction check---> Package MariaDB-common.x86_64 0:10.0.10-1.el6 will be installed--> Processing Dependency: MariaDB-compat for package: MariaDB-common-10.0.10-1.el6.x86_64---> Package MariaDB-oqgraph-engine.x86_64 0:10.0.10-1.el6 will be installed--> Processing Dependency: libJudy.so.1()(64bit) for package: MariaDB-oqgraph-engine-10.0.10-1.el6.x86_64---> Package perl-DBI.x86_64 0:1.609-4.el6 will be installed---> Package unixODBC.x86_64 0:2.2.14-12.el6_3 will be installed--> Processing Dependency: libltdl.so.7()(64bit) for package: unixODBC-2.2.14-12.el6_3.x86_64--> Running transaction check---> Package MariaDB-compat.x86_64 0:10.0.10-1.el6 will be obsoleting---> Package MariaDB-oqgraph-engine.x86_64 0:10.0.10-1.el6 will be installed--> Processing Dependency: libJudy.so.1()(64bit) for package: MariaDB-oqgraph-engine-10.0.10-1.el6.x86_64---> Package libtool-ltdl.x86_64 0:2.2.6-15.5.el6 will be installed---> Package mysql-libs.x86_64 0:5.1.73-3.el6_5 will be obsoleted--> Finished Dependency ResolutionError: Package: MariaDB-oqgraph-engine-10.0.10-1.el6.x86_64 (mariadb) Requires: libJudy.so.1()(64bit) You could try using --skip-broken to work around the problem You could try running: rpm -Va --nofiles --nodigestroot@centos-6.5-minimal:[Mon May 05 12:53:42][~]$ yum whatprovides *libJudyLoaded plugins: fastestmirrorLoading mirror speeds from cached hostfile * base: mirrors.ircam.fr * extras: distrib-coffee.ipsl.jussieu.fr * updates: mir01.syntis.netbase/filelists_db | 5.9 MB 00:11 extras/filelists_db |11 kB 00:00 mariadb/filelists_db|56 kB 00:00 updates/filelists_db| 1.7 MB 00:03 No Matches foundroot@centos-6.5-minimal:[Mon May 05 12:54:20][~]$
So, it seems the MariaDB-oqgraph-engine-10.0.10-1 needs the libJudy which is missing at CentOS minimal install defaut repos.
Athttps: // mariadb.atlassian.net/browse/MDEV-5664there is detailed explanation, in short you have to set the epel repo.
How to set the Epel CentOS 6.5 repo:
root@centos-6.5-minimal:[Mon May 05 13:01:59][/etc/yum.repos.d]$ wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpmroot@centos-6.5-minimal:[Mon May 05 13:02:14][/etc/yum.repos.d]$ rpm -Uvh epel-release-6-8.noarch.rpmroot@centos-6.5-minimal:[Mon May 05 13:02:29][/etc/yum.repos.d]$ yum repolistLoaded plugins: fastestmirrorLoading mirror speeds from cached hostfileepel/metalink |25 kB 00:00* base: sunsite.rediris.es * epel: ftp.cica.es * extras: ftp.rezopole.net * updates: centos.quelquesmots.frepel| 4.4 kB 00:00 epel/primary_db | 6.1 MB 00:09 repo id repo namestatusbaseCentOS-6 - Base 6,367epelExtra Packages for Enterprise Linux 6 - x86_64 10,762extrasCentOS-6 - Extras14mariadb MariaDB12updates CentOS-6 - Updates
Now, install libJudy:
root@centos-6.5-minimal:[Mon May 05 13:05:44][/etc/yum.repos.d]$ yum install Judy
Then install the MariaDB server, client and the available engines:
root@centos-6.5-minimal:[Mon May 05 13:06:12][/etc/yum.repos.d]$ yum install MariaDB-server MariaDB*engine MariaDB-client
Start the MariaDB 10.0.10 MySQL service, check the installed engines and the configured plug-ins directory:
root@centos-6.5-minimal:[Mon May 05 13:13:53][/etc/yum.repos.d]$ mysql ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2 "No such file or directory")root@centos-6.5-minimal:[Mon May 05 13:15:38][/etc/yum.repos.d]$ service mysql Usage: mysql{start|stop|restart|reload|force-reload|status|configtest}[ MySQL server options ]root@centos-6.5-minimal:[Mon May 05 13:15:47][/etc/yum.repos.d]$ service mysqlstatus ERROR! MySQL is not runningroot@centos-6.5-minimal:[Mon May 05 13:15:53][/etc/yum.repos.d]$ service mysqlstartStarting MySQL. SUCCESS! root@centos-6.5-minimal:[Mon May 05 13:16:06][/etc/yum.repos.d]$ mysql Welcome to the MariaDB monitor.Commands end with ; or /g.Your MariaDB connection id is 3Server version: 10.0.10-MariaDB MariaDB ServerCopyright (c) 2000, 2014, Oracle, SkySQL Ab and others.Type 'help;' or '/h' for help. Type '/c' to clear the current input statement.mysql root@centos-6.5-minimal:[Mon May5 13:16:08 2014][(none)]> show engines;+--------------------+---------+----------------------------------------------------------------------------+--------------+------+------------+| Engine | Support | Comment| Transactions | XA | Savepoints |+--------------------+---------+----------------------------------------------------------------------------+--------------+------+------------+| CSV| YES | CSV storage engine | NO | NO | NO || MRG_MyISAM | YES | Collection of identical MyISAM tables| NO | NO | NO || MEMORY | YES | Hash based, stored in memory, useful for temporary tables| NO | NO | NO || BLACKHOLE| YES | /dev/null storage engine (anything you write to it disappears) | NO | NO | NO || MyISAM | YES | MyISAM storage engine| NO | NO | NO || InnoDB | DEFAULT | Percona-XtraDB, Supports transactions, row-level locking, and foreign keys | YES| YES| YES|| ARCHIVE| YES | Archive storage engine | NO | NO | NO || FEDERATED| YES | FederatedX pluggable storage engine| YES| NO | YES|| PERFORMANCE_SCHEMA | YES | Performance Schema | NO | NO | NO || Aria | YES | Crash-safe tables with MyISAM heritage | NO | NO | NO || OQGRAPH| YES | Open Query Graph Computation Engine (http://openquery.com/graph) | NO | NO | NO || CASSANDRA| YES | Cassandra storage engine | NO | NO | NO || CONNECT| YES | Management of External Data (SQL/MED), including many file formats | NO | NO | NO |+--------------------+---------+----------------------------------------------------------------------------+--------------+------+------------+13 rows in set (0.00 sec)mysql root@centos-6.5-minimal:[Mon May5 13:16:30 2014][(none)]> SHOW GLOBAL VARIABLES LIKE 'plugin_dir';+---------------+--------------------------+| Variable_name | Value|+---------------+--------------------------+| plugin_dir| /usr/lib64/mysql/plugin/ |+---------------+--------------------------+1 row in set (0.02 sec)
As you can see above, the OQGRAPH and CONNECT engines are available now.
So, how to test the CONNECT engine sqlite3 db handler?
First, take a look athttps: // mariadb.com/kb/en/connect-table-types-odbc-table-type-accessing-...page
In short, you need to setup the unixODBC driver for the CONNECT engine sqlite3 handler.
How to setup sqliute3 unixODBC driver on CentOS 6.5 minimal install:
1. Check the existing odbc setup:
root@centos-6.5-minimal:[Mon May 05 13:29:16][~]$ cat /etc/odbcinst.ini# Example driver definitions# Driver from the postgresql-odbc package# Setup from the unixODBC package[PostgreSQL]Description= ODBC for PostgreSQLDriver= /usr/lib/psqlodbc.soSetup= /usr/lib/libodbcpsqlS.soDriver64= /usr/lib64/psqlodbc.soSetup64= /usr/lib64/libodbcpsqlS.soFileUsage= 1# Driver from the mysql-connector-odbc package# Setup from the unixODBC package[MySQL]Description= ODBC for MySQLDriver= /usr/lib/libmyodbc5.soSetup= /usr/lib/libodbcmyS.soDriver64= /usr/lib64/libmyodbc5.soSetup64= /usr/lib64/libodbcmyS.soFileUsage= 1root@centos-6.5-minimal:[Mon May 05 13:29:22][~]$ odbcinst -q -d[PostgreSQL][MySQL]
It seems the sqlite3 unixODBC is missing:
root@centos-6.5-minimal:[Mon May 05 13:30:38][~]$ locate libsqlite/usr/lib64/libsqlite3.so.0/usr/lib64/libsqlite3.so.0.8.6root@centos-6.5-minimal:[Mon May 05 13:32:46][~]$ yum search sqlite | grep -i odbc
We find nothing.
So the good old way/my preferred one/to do it is to compile the sqlite3 unixODBC driver as explained athttp: // www.ch-werner.de/sqliteodbc /:
root@centos-6.5-minimal:[Mon May 05 13:33:37][/opt/installs]$ wget http://www.ch-werner.de/sqliteodbc/sqliteodbc-0.996.tar.gzroot@centos-6.5-minimal:[Mon May 05 13:33:41][/opt/installs]$ tar xvf sqliteodbc-0.996.tar.gzroot@centos-6.5-minimal:[Mon May 05 13:33:50][/opt/installs]$ cd sqliteodbc-0.996root@centos-6.5-minimal:[Mon May 05 13:34:22][/opt/installs/sqliteodbc-0.996]$ ./configure checking build system type... x86_64-redhat-linux-gnuchecking host system type... x86_64-redhat-linux-gnuchecking for gcc... nochecking for cc... nochecking for cc... nochecking for cl... noconfigure: error: no acceptable C compiler found in $PATHSee `config.log' for more details.
As expected, the minimal install of the CentOS 6.5 does not have the needed gcc make etc dev tools.
How to install the development environment:
root@centos-6.5-minimal:[Mon May 05 13:34:35][/opt/installs/sqliteodbc-0.996]$ yum groupinstall 'Development Tools'.....Install 104 Package(s)Total download size: 93 MInstalled size: 272 MIs this ok [y/N]: yComplete! root@centos-6.5-minimal:[Mon May 05 13:54:57][/opt/installs/sqliteodbc-0.996]$ ./configure ...checking for sqlite3_close_v2 in -lsqlite3... nonoconfigure: WARNING: SQLite4 header file and source not foundconfigure: error: No usable SQLite header/library on this system
Here the issue is the missing sqlite3 devel headers. This can be fixed by installing the sqlite-devel package with yum:
root@centos-6.5-minimal:[Mon May 05 13:55:33][/opt/installs/sqliteodbc-0.996]$ yum install sqlite-develInstalled:sqlite-devel.x86_64 0:3.6.20-1.el6 Complete!root@centos-6.5-minimal:[Mon May 05 13:56:53][/opt/installs/sqliteodbc-0.996]$ ./configure ...checking for ODBC headers and libraries... noconfigure: error: ODBC header files and/or libraries not found
New issue: ODBC header files are missing. Again, fix that by installing unixODBC-devel package:
root@centos-6.5-minimal:[Mon May 05 13:57:11][/opt/installs/sqliteodbc-0.996]$ yum install unixODBC-develroot@centos-6.5-minimal:[Mon May 05 13:58:11][/opt/installs/sqliteodbc-0.996]$ ./configure ..checking for gmtime_r... yesconfigure: creating ./config.statusconfig.status: creating Makefileconfig.status: creating sqliteodbc.specconfig.status: creating debian/changelogroot@centos-6.5-minimal:[Mon May 05 13:58:29][/opt/installs/sqliteodbc-0.996]$ make -j3 gcc -shared.libs/sqlite3odbc.o-lsqlite3 -ldl-Wl,-soname -Wl,libsqlite3odbc-0.996.so -o .libs/libsqlite3odbc-0.996.so(cd .libs && rm -f libsqlite3odbc.so && ln -s libsqlite3odbc-0.996.so libsqlite3odbc.so)ar cru .libs/libsqlite3odbc.asqlite3odbc.oranlib .libs/libsqlite3odbc.acreating libsqlite3odbc.la(cd .libs && rm -f libsqlite3odbc.la && ln -s ../libsqlite3odbc.la