Score:0

MySQL not saving to separate data directories

in flag

Lately I've been struggling with MySQL and it's data directory a lot. At first, I've tried docker for multiple instances but our company doesn't prefer docker no one knows why.

So I come up with a solution.

Some information;

  • Multiple servers (6) will send data (like multi-source replication) and one slave
  • According to our manager, six is too much dangerous to create a multi-source one slave replica set
  • I've ordered additional IP's and configured them.
  • Right now, the slave server has 3 IP's from dedicated server provider.
  • I can ping those IP's, I can connect to phpmyadmin with new IP's
  • The only thing is not working is where MySQL puts the data
  • I edited config files and changed all other IP's data directories and ports
  • Config files I've edited are in > /etc/mysql/maridadb.conf.d/50-server(n).cnf
  • But anytime I create some database in one other IP assigned MySQL, other MySQL IP's can also see and perform actions on it.

Below you can see the image for maria config's for different instances.

This part confuses me, since I separated them with different IP's and data directories, how they can still see others. Anytime I create a database in MySQL, it puts to /var/lib/mysql.

How can I manage one server, multiple IP's-Ports and multiple MySQL databases without each other seeing/accessing them?

maria server config settings

Phill  W. avatar
cn flag
You say that you're "struggling with the Data Directory" and that what's "not working" is where MySQL/MariaDB puts its data. The rest of your posting is about something completely different, as far as I can tell. Forget this overly-complex, Heath Robinson attempt - what problem are you actually trying to solve? What's "not working"?
emir ko avatar
in flag
MySQL always puts the data to /var/lib/mysql even though I configure the data-dir as other location.
Phill  W. avatar
cn flag
Post the configuration file in which you made this change.
ua flag
Is the server "in house" or is it provided by a Cloud company?
ua flag
How are you telling it to look in `[mysql1]` and not in `[mysql]` ?
emir ko avatar
in flag
I am adding configurations to, `/etc/mysql/mariadb.conf/50-server(n).cnf` And activating all the mysql instances with `mysqld_multi start` In the original question, I've added the screenshot for 50-server1.cnf and 50-server2.cnf In those config files, I use `datadir` to define the data path that I want mysql to use. This server is bare-metal provided by hetzner.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.