0

I have two virtual servers on one physical machine.

There are MySQL users and passwords the same for both of them.

I want to write something like this:

SELECT * FROM [host_name].[db_name].[table_name]

Federated / FederatedX is not a solution for me. At least I want to avoid using it if it is possible.

If what I want is not possible I need some solution to do the following:

I have two MySQL servers: server1 and server2.

I want to set a trigger on a few tables in server1 so i.e. when new row appears there a part of that row should go to server2.

I don't want an entire row to be replicated. There might be some values on which I will want to remove some rows form server2 and e.t.c.

I was thinking I should call some procedure on the trigger if it is possible.

2
  • And why isn't federation a solution for you?
    – mustaccio
    Commented May 1, 2019 at 12:32
  • I just wanted a better solution, though there would be [host_name].[db_name].[table_name] solution but I couldn't find one. I'm gonna go with federated for now unless anyone gives me some better approach.
    – temo
    Commented May 1, 2019 at 14:42

1 Answer 1

1

No. One connection can talk to only one MySQL server.
Any Stored Routine lives in a single MySQL server, so another connection is not allowed for.

3
  • Any update on the solution? Is it still not possible to connect different host? I did try to search but didn't find anything.
    – Code_Crash
    Commented Apr 12, 2023 at 15:54
  • Well, MariaDB has ENGINE=FEDERATEDX
    – Rick James
    Commented Apr 12, 2023 at 17:47
  • Thank you, I will check.
    – Code_Crash
    Commented Apr 13, 2023 at 18:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.