This article is half-done without your Comment! *** Please share your thoughts via Comment ***
In the previous post, I shared a basic theory on the FEDERATED Table Engine.
As earlier I discussed that, FEDERATED Engine is not by default enabled so In this post; I am giving basic commands to enable and configure FEDERATED Table Engine.
First Check FEDERATED engine is available or not:
1 |
SHOW ENGINES; |
Using above commands, we can get all available engines.
In the above image, you cannot find a FEDERATED engine, so we need to install it.
Command to enable federated engine.
1 |
install plugin federated soname 'ha_federated.so' |
Now check all engines details:
In the above result, we can find a new entry of FEDERATED engine, but still, it is OFF.
To enable this, we need to add a federated line into my.cnf file
Command to open my.cnf file:
1 |
sudo nano /etc/my.cnf |
Write federated into this file:
1 2 3 4 5 6 7 8 9 10 11 |
[mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock user=mysql # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0 federated [mysqld_safe] log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid |
Restart Mysqld:
1 |
sudo service mysqld restart |
Now check all engines details and find FEDERATED engine is ON: