Configuring MariaDB (or MySQL) Replication

1 post in this topic

Got tired of having to re-read three or four guides to remember how to set up MariaDB/MySQL replication:


This is what I think of as "the right way" to set it up -- especially when you have an existing live database that you want to replicate. You don't have to stop the master, get its log position, and copy that over to the slave by hand. No extraneous user creation, either.


The problem with needing the same users on the slave as the master was kinda weird. It only happens with a few Rails apps I manage replication for. They connect to MariaDB as their own users (not as root). Everything was going fine until someone ran some migrations on the production server. This caused replication to stop due to an error (forget the number) about the user that executed the procedure on master not existing on the slave. Added the user, granted the proper permissions on the slave DB, and it was fine.


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now