Posts Tagged ‘mariadb’

Identify Cross Database Foreign Keys

I’ve blogged before about cross-database foreign keys and what I think of them. I had a developer wanting to check for such references between two databases today. Here’s what I came up with to do this… ?View Code MYSQLSELECT t.NAME AS TABLE_NAME, i.NAME AS INDEX_NAME, f.* FROM information_schema.`INNODB_SYS_FOREIGN` f INNER JOIN information_schema.`INNODB_SYS_INDEXES` i ON i.`NAME` […]

mysqldump: backing up specific tables

Here’s a quick example of how to backup specific MySQL / MariaDB tables and piping to xz to compress… ?View Code BASHmysqldump -h -P3306 mysql user tables_priv | xz –compress -9 > /db_dumps/3104/mysqldump_tables_example.sql.xz Here’s how to decompress the resulting file. Note xz will delete the input file unless you specifiy –keep on the command […]


You may receive the following error with MariaDB on a Windows platform when attempting to create a table using the federatedx engine. 1 queries executed, 0 success, 1 ERRORS, 0 WARNINGS QUERY: CREATE TABLE t1 ENGINE=FEDERATED CONNECTION=”server” Error CODE: 1286 UNKNOWN STORAGE ENGINE ‘FEDERATED’ Execution TIME : 0 sec Transfer TIME : 0 sec Total […]

Bash script to execute a MariaDB query multiple times

This simple bash script will execute a query 100 times against a MySQL instance. It also uses the time command to report how long the entire process took. I use this for some very simple bench-marking. The query used here creates a temporary table and inserts 100K rows into it. You need the sequence engine […]

ERROR Failed to open the relay log ‘7’ (relay_log_pos 0)

I received the following error when I upgraded modified a slave from MySQL 5.6.14 to MariaDB 5.5.33 and executing “START SLAVE;”. 131106 11:12:31 [ERROR] Failed to open the relay log ‘7’ (relay_log_pos 0) I checked my file and it looked like below… 7 /logs/relay/hostname-relaylog.000046 661930553 hostname-masterlog.000019 661930383 0 0 0 Obviously there a difference […]