How to install federated engine to my mariadb? - mysql

I know many of post have mention mariadb in xampp already include federated engine, but unfortunately the federated engine hasn't installed in my mariadb as you can see in the table below.
MariaDB [information_schema]> show engines;
+--------------------+---------+--------------------------------------------------------------------------------------------------+--------------+------+------------+
| Engine | Support | Comment | Transactions | XA | Savepoints |
+--------------------+---------+--------------------------------------------------------------------------------------------------+--------------+------+------------+
| CSV | YES | CSV storage engine | NO | NO | NO |
| InnoDB | DEFAULT | Percona-XtraDB, Supports transactions, row-level locking, foreign keys and encryption for tables | YES | YES | YES |
| MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO |
| MyISAM | YES | MyISAM storage engine | NO | NO | NO |
| MRG_MyISAM | YES | Collection of identical MyISAM tables | NO | NO | NO |
| Aria | YES | Crash-safe tables with MyISAM heritage | NO | NO | NO |
| PERFORMANCE_SCHEMA | YES | Performance Schema | NO | NO | NO |
| SEQUENCE | YES | Generated tables filled with sequential values | YES | NO | YES |
+--------------------+---------+--------------------------------------------------------------------------------------------------+--------------+------+------------+
8 rows in set (0.00 sec)
I also tried to follow the guide here and run this command INSTALL PLUGIN federated SONAME 'ha_federatedx.so'; but got error ERROR 1126 (HY000): Can't open shared library 'D:\xampp\mysql\lib\plugin\ha_federatedx.so.dll' (errno: 2, The specified module could not be found. . Can anyone tell me how to install the federated engine without re-install xampp? My database version is mysql Ver 15.1 Distrib 10.1.10-MariaDB, for Win32 (AMD64)

I know this answer likely comes several years too late, but I was having the same problem this morning on a Windows development machine. I tried ...
INSTALL PLUGIN federated SONAME 'ha_federatedx.so';
... but it didn't work, and I received the same error as Deno did. After some searching, I found that *.so files are Linux shared library files, so I tried the following command ...
INSTALL PLUGIN federated SONAME 'ha_federatedx.dll';
... and it worked! The only caveat is I am working with an actual install of MariaDB, not the version installed in XAMPP, so the actual DLL file might need to be installed in XAMPP.
Hopefully, this will help someone else who is experiencing the same problem.

Related

How does Encryption on MySQL work MySQL version 5.7?

Following steps are followed to enable MySQL encryption.
Mysql version 5.7 is installed on apache server. So by default keyring_file.so is available at following path: /usr/lib64/mysql/plugin/keyring_file.
In /etc/my.cnf below 2 code is added and MySQL is restarted.
early-plugin-load=keyring_file.so
keyring_file_data=/var/lib/mysql-keyring/keyring
When below query is executed to check if keyring plugin is active. It outputs as active
SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME LIKE 'keyring%';
+--------------+---------------+
| PLUGIN_NAME | PLUGIN_STATUS |
+--------------+---------------+
| keyring_file | ACTIVE |
+--------------+---------------+
Encryption is enabled on table level (on table author of DB testDB), It can be checked using below query
SELECT TABLE_SCHEMA, TABLE_NAME, CREATE_OPTIONS FROM INFORMATION_SCHEMA.TABLES WHERE CREATE_OPTIONS LIKE '%ENCRYPTION%';
+--------------+------------+----------------+
| TABLE_SCHEMA | TABLE_NAME | CREATE_OPTIONS |
+--------------+------------+----------------+
| testDB | author | ENCRYPTION="Y" |
+--------------+------------+----------------+
Data is inserted in author table as "plain text". However, though the table is encrypted.
select * from author;
+------+----------+-------------+
| id | name | email |
+------+----------+-------------+
| 1 | PQR | xuz#abc.com |
| 1 | XYZ | abc#abc.com |
| 1 | SSSS | xyz#abc.com |
| 1 | dfdfdf | prq#abc.com |
+------+----------+-------------+
What needs to be done to enable encryption on MySQL table?
What you enabled was innodb data at rest encryption, which is a transparent encryption technique, meaning authenticated and authorised users will not even notice it. As the mysql FAQ says on decryption:
InnoDB data-at-rest encryption is designed to transparently apply encryption within the database without impacting existing applications. Returning data in encrypted format would break most existing applications. InnoDB data-at-rest encryption provides the benefit of encryption without the overhead associated with traditional database encryption solutions, which would typically require expensive and substantial changes to applications, database triggers, and views.

PHPMyAdmin | Event Scheduler cannot enabled and get #1577 error

I've stuck on this problem for a while.
I need to schedule a job for my query daily so I have to set global event_scheduler = ON
and I got this message ..
1577 - Cannot proceed because system tables used by Event Scheduler were found damaged at server start
some guys told me i have to restart db and do it again but it's not work.
I was going to my.cnf and type event_scheduler = ON in [mysqld] section and restart again
and it's still DISABLED.
someone told me it's a bug of version 5.5 but i'm using 5.6 .....
MariaDB [(none)]> SHOW VARIABLES LIKE "%version%";
+-------------------------+---------------------+
| Variable_name | Value |
+-------------------------+---------------------+
| innodb_version | 5.6.22-72.0 |
| protocol_version | 10 |
| slave_type_conversions | |
| version | 10.0.17-MariaDB |
| version_comment | Source distribution |
| version_compile_machine | i386 |
| version_compile_os | osx10.6 |
| version_malloc_library | system |
+-------------------------+---------------------+
so I have no any idea what should i do with this thing :(
I also can't access the EVENT table in information_schema db with the same error.
if anyone can solve my problem. i'll owe you guys my entire life.
** i sincerely apologise if it's a stupid question **
Ps. I use XAMPP.
It is generally a good idea to research error codes and messages:
https://serverfault.com/questions/385015/mysql-damaged-system-tables
https://serverfault.com/questions/562282/mysqldump-error-1557-corrupt-event-table
https://serverfault.com/questions/100685/cannot-proceed-because-system-tables-used-by-event-scheduler-were-found-damaged
https://bugs.mysql.com/bug.php?id=70975

How can I change my default storage engine to MYISAM? [duplicate]

I am using mac and I installed mysql using homebrew.
brew install mysql
pretty standard installation.
mysql> show engines;
+------------+---------+------------------------------------------------------------+--------------+------+------------+
| Engine | Support | Comment | Transactions | XA | Savepoints |
+------------+---------+------------------------------------------------------------+--------------+------+------------+
| MRG_MYISAM | YES | Collection of identical MyISAM tables | NO | NO | NO |
| CSV | YES | CSV storage engine | NO | NO | NO |
| MyISAM | DEFAULT | Default engine as of MySQL 3.23 with great performance | NO | NO | NO |
| InnoDB | YES | Supports transactions, row-level locking, and foreign keys | YES | YES | YES |
| MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO |
+------------+---------+------------------------------------------------------------+--------------+------+------------+
I would like innodb to be the default storage engine. What do I need to do?
Under [mysqld] section in your ini file, add:
default-storage-engine = innodb
It is usually /etc/my.cnf, but not sure about Mac.
From the docs:
On Unix, Linux and Mac OS X, MySQL programs read startup options from the following files, in the specified order (top items are used first).
File Name Purpose
/etc/my.cnf Global options
/etc/mysql/my.cnf Global options (as of MySQL 5.1.15)
SYSCONFDIR/my.cnf Global options
$MYSQL_HOME/my.cnf Server-specific options
defaults-extra-file The file specified with --defaults-extra-file=path, if any
~/.my.cnf User-specific options
The last one is never used by the daemon.
I can see from phpMyAdmin that MySQL has a database called information_schema, and it contains a table called ENGINES. Aside from the more global scenario of changing an ini file, wouldn't it be a simple solution to switch the table's SUPPORT fields for MyISAM and InnoDB (to 'YES' and 'DEFAULT' respectively)? I haven't done it myself, so proceed at your own risk ... and let me know how things turn out if you do.

how to generate ERD or UML for a database?

Referencing a previous question, it doesn't seem possible to easily autogenerate a UML or ERD graph. How can this be done? Even the the detail which describe fudforum.*; provides would do the trick, except that you can't use a wildcard.
Something like mysqldump -d -u <username> -p<password> -h <hostname> <dbname> but more readable?
It looks like devart doesn't run on Linux, but I'm looking into that.
mysql:
mysql>
mysql> describe fudforum.fud30_xmlagg;
+----------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------------+--------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| name | varchar(255) | NO | | | |
| url | varchar(255) | NO | | | |
| forum_id | int(11) | NO | MUL | 0 | |
| xmlagg_opt | int(11) | NO | | 2 | |
| last_load_date | bigint(20) | NO | | 0 | |
| custom_sig | text | YES | | NULL | |
+----------------+--------------+------+-----+---------+----------------+
7 rows in set (0.04 sec)
mysql>
mysql> quit;
Bye
thufir#dur:~$
mysql workbench can reverse engineer and create erd's
http://www.mysql.com/products/workbench/
I've tried many times to get MySQL Workbench to auto generate an ERD with relationship lines but always left frustrated. Most of the databases I was working with used MyISAM tables without defined foreign keys. That seemed to prevent Workbench from generating the relationships I wanted or I just couldn't understand how to make it work. I tried many other solution as well but again never found the easy solution I was looking for until I stumbled on this blog post at mysqlworkbench.org.
MySQL Workbench Plugin: Auto-Create Foreign Keys
The post is a full explanation on how to get Workbench to search all of your tables for candidate foreign keys in other tables. It even shows how to get a working GUI for it. The best part is that the article links to a Python script that can be installed in Workbench as a plugin so you it's all handled for you.
Once the plugin is installed you run it and give it a pattern to use for testing whether keys match. It then gives you a list of the keys it thinks match which you can select if you agree. Then you click a button and it generates the ERD for you with all the relationship lines in place. Hallelujah!
Many thanks to akojima at MySQL Workbench. Now if only I could take the Delorean back four years and find this when it was published in 2010.
There is a tutorial how to convert Oracle 10G to UML using Eclipse and Dali plugin.
You can just swap Oracle with your database sql connector inside Dali and it would do the job.
mysqlshow command:
mysqlshow fudforum

change mysql default engine to innodb

I am using mac and I installed mysql using homebrew.
brew install mysql
pretty standard installation.
mysql> show engines;
+------------+---------+------------------------------------------------------------+--------------+------+------------+
| Engine | Support | Comment | Transactions | XA | Savepoints |
+------------+---------+------------------------------------------------------------+--------------+------+------------+
| MRG_MYISAM | YES | Collection of identical MyISAM tables | NO | NO | NO |
| CSV | YES | CSV storage engine | NO | NO | NO |
| MyISAM | DEFAULT | Default engine as of MySQL 3.23 with great performance | NO | NO | NO |
| InnoDB | YES | Supports transactions, row-level locking, and foreign keys | YES | YES | YES |
| MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO |
+------------+---------+------------------------------------------------------------+--------------+------+------------+
I would like innodb to be the default storage engine. What do I need to do?
Under [mysqld] section in your ini file, add:
default-storage-engine = innodb
It is usually /etc/my.cnf, but not sure about Mac.
From the docs:
On Unix, Linux and Mac OS X, MySQL programs read startup options from the following files, in the specified order (top items are used first).
File Name Purpose
/etc/my.cnf Global options
/etc/mysql/my.cnf Global options (as of MySQL 5.1.15)
SYSCONFDIR/my.cnf Global options
$MYSQL_HOME/my.cnf Server-specific options
defaults-extra-file The file specified with --defaults-extra-file=path, if any
~/.my.cnf User-specific options
The last one is never used by the daemon.
I can see from phpMyAdmin that MySQL has a database called information_schema, and it contains a table called ENGINES. Aside from the more global scenario of changing an ini file, wouldn't it be a simple solution to switch the table's SUPPORT fields for MyISAM and InnoDB (to 'YES' and 'DEFAULT' respectively)? I haven't done it myself, so proceed at your own risk ... and let me know how things turn out if you do.