How to Setup two MySql Instances on a Single Machine
Posted By : Vishal Kumar | 29-Nov-2018
MySql Installation: On the off chance that you as of now have one instance of MySQL database introduced on your machine, you can avoid this progression.
The most straightforward approach to introduce MySQL on the Ubuntu is to run the accompanying direction from a terminal incite:
Amid the establishment procedure, you will be provoked to set a password key for the MySQL root client.
mysqld_multi Setup: With the end goal to oversee two MySQL occurrences on a similar machine productively, we have to
The initial phase in setting up mysqld_multi is the making of two separate [mysqld] bunches in the current my.cnf record. Default area of my.cnf record on the Ubuntu is /etc/mysql/. Along these lines, open
server-id include the accompanying line in [mysqld1] gathering:
Since we require a different [mysqld] assemble for the second MySQL instance, duplicate the [mysqld1] aggregate with every single current design, and glue it beneath in the equivalent my.cnf record. Presently, rename the replicated gathering to [mysqld2], and roll out the accompanying improvements in the arrangement for the slave:
Aside from the [mysqld1] and [mysqld2] gatherings, we likewise need to add another gathering [mysqld_multi] to
When we introduce the second MySQL example, and we start up both, we will give fitting benefits to the multi_admin client with the end goal to have the capacity to close down MySQL occasions.
AppArmor Security Settings: In some Linux conditions, AppArmor security settings are required with the end goal to run the second MySQL case. In any event, they are required on Ubuntu.
To legitimately set-up AppArmor, alter /etc/apparmor.d/
After you spare the record, reboot the machine all together for these progressions to produce results.
Second MySql Instance Installation: Execute the accompanying order with the end goal to introduce new MySQL data directory:
Once MySQL information index is introduced, you can begin both MySQL occurrences utilizing the mysqld_multi benefit:
Set the root secret key for the second MySQL occurrence by utilizing the
In the model above I set the password to "
Hope this will be helpful for you