0

I have two mariadb servers one is configured as master and the other as a replica of this master. I have created a database named params on master and it has a table with a couple of items in it.

How can I see this table and access or modify it using the mysql shell on the replica?

Is this even possible or I have miss understood the replication altogether?

max
  • 2,627
  • 1
  • 24
  • 44

1 Answers1

1

Check that replication works

If you aren't seeing the database on the slave replica, it would be good to check that the output of SHOW SLAVE STATUS doesn't return any errors. A good resource for getting started with replication is the MariaDB KB article on the subject.

When you have confirmed that replication works, you can connect to the slave replica and you should see the database there.

How replication works in MariaDB

Replication in MariaDB will propagate all changes that happen on the master server to any slave servers that are replicating from it. This allows you to read the same data from multiple places without burdening the master server. It does not allow you to seamlessly share data across multiple servers (a Galera cluster offers some of this).

The downside of master-slave replication is that when you want to make a change, you have to make it on the master in order to keep the data consistent across all servers. The benefit of it is the higher availability of your data and increased throughput of read queries. The Replication Overview article has a more detailed description of what replication is and lists some use cases for it.

markusjm
  • 2,358
  • 1
  • 11
  • 23