'Error on remote system: 0 'when using FederatedX on MariaDB - mariadb

I am using MariaDB 10.1 64x and experiencing error with FederatedX engine.
First, I create an server:
CREATE SERVER AAA_fed
Foreign data Wrapper mysql_1
OPTIONS (
User 'user1',
password 'password',
host 'x.x.x.x',
Port 3306,
database 'AAA'
);
and then create federated table using connection to the server.
CREATE TABLE table1
ENGINE = FEDERATED
CONNECTION='AAA_fed';
The table is created successfully, but when selecting data from it, it response an error:
Error Code: 1296. Got error 10000 'Error on remote system: 0: ' from
FEDERATED
Does anyone know the solution to this? I keep searching but cannot find the answer. Thank you.

WRAPPER should be a recognized connection protocol.
Example:
MariaDB [(none)]> SELECT VERSION();
+--------------------------+
| VERSION() |
+--------------------------+
| 10.1.14-MariaDB-1~xenial | -- 64 bit
+--------------------------+
1 row in set (0.00 sec)
MariaDB [(none)]> DROP DATABASE IF EXISTS `BBB`;
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> DROP DATABASE IF EXISTS `AAA`;
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> CREATE DATABASE IF NOT EXISTS `AAA`;
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> CREATE DATABASE IF NOT EXISTS `BBB`;
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> CREATE TABLE IF NOT EXISTS `AAA`.`table1` (
-> `id` int(20) NOT NULL,
-> `name` varchar(64) NOT NULL default ''
-> ) ENGINE='InnoDB';
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> DROP SERVER IF EXISTS `AAA_fed`;
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> CREATE SERVER IF NOT EXISTS `AAA_fed`
-> FOREIGN DATA WRAPPER `mysql_1` -- <-- Unsupported
-> OPTIONS (
-> HOST 'x.x.x.x',
-> DATABASE 'AAA',
-> USER 'user1',
-> PASSWORD 'password',
-> PORT 3306,
-> SOCKET '/path/to/mysqld.sock',
-> OWNER 'user1'
-> );
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> CREATE TABLE IF NOT EXISTS `BBB`.`table1`
-> ENGINE=FEDERATED CONNECTION='AAA_fed';
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> SELECT `id`, `name` FROM `BBB`.`table1`;
ERROR 1296 (HY000): Got error 10000 'Error on remote system: 0: ' from FEDERATED
MariaDB [(none)]> DROP TABLE IF EXISTS `BBB`.`table1`;
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> DROP SERVER IF EXISTS `AAA_fed`;
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> CREATE SERVER IF NOT EXISTS `AAA_fed`
-> FOREIGN DATA WRAPPER `mysql` -- <-- Supported
-> OPTIONS (
-> HOST 'x.x.x.x',
-> DATABASE 'AAA',
-> USER 'user1',
-> PASSWORD 'password',
-> PORT 3306,
-> SOCKET '/path/to/mysqld.sock',
-> OWNER 'user1'
-> );
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> CREATE TABLE IF NOT EXISTS `BBB`.`table1`
-> ENGINE=FEDERATED CONNECTION='AAA_fed';
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> SELECT `id`, `name` FROM `BBB`.`table1`;
Empty set (0.00 sec)

There is also one reason for this error. Which occurs when you created a federated table, that pointing to a table in the same server.

Related

ViciDial: MyISAM Specified key was too long; max key length is 1000 bytes

I have installed MariaDB in a Ubuntu 14.04 and trying to run some scripts that the main solution provides (ViciDial). When I try to execute the Sql file, it gives an error in the following CREATE TABLE statement:
CREATE TABLE www_phrases (
phrase_id INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
phrase_text VARCHAR(10000) default '',
php_filename VARCHAR(255) NOT NULL,
php_directory VARCHAR(255) default '',
source VARCHAR(20) default '',
insert_date DATETIME,
index (phrase_text)
) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci;
The error is:
ERROR 1071 (42000) at line 3348: Specified key was too long; max key length is 1000 bytes
MariaDB status:
MariaDB [DialerDB]> status;
--------------
mysql Ver 15.1 Distrib 10.0.38-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
Connection id: 53
Current database: DialerDB
Current user: root#localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server: MariaDB
Server version: 10.0.38-MariaDB-0ubuntu0.16.04.1 Ubuntu 16.04
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: utf8mb4
Db characterset: utf8mb4
Client characterset: utf8mb4
Conn. characterset: utf8mb4
UNIX socket: /var/run/mysqld/mysqld.sock
Uptime: 1 hour 15 min 49 sec
As far as I understand the limit in MyISAM is 1000, and in newer versions is around 3200, so if the varchar is 10000 this is an error, correct?
But this software is installed correctly if done via installer (an ISO image) and the DB tables are the same...so there must be some config limiting my MariaDB to do this.
Any idea?
If that column has "text" in it, suggest looking into a FULLTEXT index; it will search for words quite efficiently.
A compilation of the limits is here; 10K won't work for a simple index.
(Meanwhile, you should move from MyISAM to InnoDB.)

setting innodb_tmpdir on MariaDB

version:10.0.33-MariaDB
trying to perform an ALTER TABLE and it's running out of diskspace during the rebuild, currently using /tmp from ##tmpdir. I'm trying to set ##innodb_tmpdir from NULL to another directory and it continuously fails with the below error:
MariaDB [(none)]> set ##innodb_tmpdir = '/tmp/inno_tmpdir';
ERROR 1231 (42000): Variable 'innodb_tmpdir' can't be set to the value of '/tmp/inno_tmpdir'
MariaDB [(none)]> show warnings\G
*************************** 1. row ***************************
Level: Warning
Code: 1210
Message: InnoDB: Server doesn't have permission in the given location.
*************************** 2. row ***************************
Level: Error
Code: 1231
Message: Variable 'innodb_tmpdir' can't be set to the value of '/tmp/inno_tmpdir'
2 rows in set (0.00 sec)
I've given the directory full permissions to mysql.
[root#host tmp]# ls -lrt | grep inno_tmpdir
drwxrwxrwx. 2 mysql mysql 4096 Oct 16 12:15 inno_tmpdir
the odd part is that I can set ##innodb_tmpdir /tmp (which ##tmpdir is set to ) /usr/tmp or /var/tmp
MariaDB [(none)]> set ##innodb_tmpdir = '/var/tmp';
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> set ##innodb_tmpdir = '/usr/tmp';
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> set ##innodb_tmpdir = '/tmp';
Query OK, 0 rows affected (0.00 sec)
I had a similar problem but with MySQL 5.6.49.
What I did - it's just added full permission to the new temp directory:
chmod 777 /tmp/inno_tmpdir
and then I was able to set innodb_tmpdir = '/tmp/inno_tmpdir'
innodb_tmpdir is looked at startup, unlike some other (like innodb_data_home_dir, innodb_undo_directory)
To search for tablespaces into other directories, you must add them (comma separated in Linux, I believe) to innodb_directories.

Does MARIADB support TableSpaces?

Does MARIADB support TableSpaces ? I want to know can I create table spaces in MARIA DB - as they allow to use INNODB .
What do you get from SELECT * FROM information_schema.INNODB_SYS_TABLESPACES? See https://mariadb.com/kb/en/mariadb/information-schema-tablespaces-table/ "starting with MariaDB 5.5". However: "The table is a MariaDB and MySQL extension, and does not include information about InnoDB tablespaces."
Why are you hoping for tablespaces?

MariaDB CONNECT engine to read external file

I would like to read an external file into MariaDB using the CONNECT engine. However, when trying to read from the file, I get an error message:
MariaDB [test]> create table test ( name varchar(100), team varchar(100) ) engine=CONNECT table_type=CSV file_name='/tmp/data.csv' header=1 sep_char=',' quoted=0;
Query OK, 0 rows affected (0.24 sec)
MariaDB [test]> select * from test;
ERROR 1296 (HY000): Got error 174 'Open() error 13 on /tmp/data.csv: Permission denied' from CONNECT
Checking the filesystem permissions gives me:
divingt#grisu ~ $ ls -l /tmp/data.csv
-rw-rw-rw- 1 divingt divingt 1658 Dec 31 13:59 /tmp/data.csv
So everybody should be able to read and write from the file.
Also in MYSQL the permissions allow for everything:
MariaDB [test]> SHOW GRANTS;
+------------------------------------------------------------------------------------------------+
| Grants for root#localhost |
+------------------------------------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO 'root'#'localhost' IDENTIFIED VIA unix_socket WITH GRANT OPTION |
| GRANT PROXY ON ''#'%' TO 'root'#'localhost' WITH GRANT OPTION |
+------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)
I run a Linux Mint system.
Thanks a lot for any help.
It turns out that the reason was that apparmor prevented mysqld from reading from reading the file. Disabling it (or changing the permissions) solved the problem.

elastix cdr stop working

CDR was working before 19 march. Unfortunately i dont remember what kind of changes i made to configuration, but this exactly not changes to CDR config.
elastix 2.4.0
asterisk 11.7.0
mysql 5.0.95
elastix*CLI> cdr show status
Call Detail Record (CDR) settings
----------------------------------
Logging: Disabled
Mode: Simple
/etc/asterisk/cdr.conf
[general]
enable=yes
unanswered = yes
/etc/asterisk/cdr_mysql.conf
[global]
hostname = localhost
dbname=asteriskcdrdb
password = *MYPASSWROD*
user = asteriskcdruser
userfield=1
;port=3306
;sock=/tmp/mysql.sock
loguniqueid=yes
mysql> SHOW GRANTS FOR 'asteriskcdruser'#'localhost';
+-----------------------------------------------------------------------------------------------+
| Grants for asteriskcdruser#localhost |
+-----------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'asteriskcdruser'#'localhost' IDENTIFIED BY PASSWORD 'HASHHERE' |
| GRANT ALL PRIVILEGES ON `asteriskcdrdb`.* TO 'asteriskcdruser'#'localhost' |
+-----------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)
Try do
asterisk -rx " module reload"
For mysql info see
asterisk -rx "cdr mysql status"

Resources