Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8907507
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T02:56:03+00:00 2026-06-15T02:56:03+00:00

I am trying to set up a multi master mysql replication on two systems

  • 0

I am trying to set up a multi master mysql replication on two systems on a network. The two separate database servers are running mysql at localhost, How do I create a replication user for the hosts since they share the same name.

I could do this, but it doesn’t seem like the right thing to do.

CREATE USER 'repl_user1'@'localhost' IDENTIFIED BY 'password1';  // Server1
CREATE USER 'repl_user2'@'localhost' IDENTIFIED BY 'password2';  // Server2

I think something like this should do

CREATE USER 'repl_user1'@'server1.com' IDENTIFIED BY 'password1';  // Server1
CREATE USER 'repl_user2'@'server2.com' IDENTIFIED BY 'password2';  // Server2

but I don’t know how to give the host a name.
Thanks for any help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T02:56:05+00:00Added an answer on June 15, 2026 at 2:56 am

    You can use IPs, ex:

    CREATE USER 'repl_user1'@'192.168.1.101' IDENTIFIED BY 'password1';  // Server1
    CREATE USER 'repl_user2'@'192.168.1.102' IDENTIFIED BY 'password2';  // Server2
    

    If you really want to use hostnames (and you don’t already have some set up for your servers using DNS), just add them to your hosts file and reference those. Ex.:

    /etc/hosts (server1)

    127.0.0.1         localhost server1.local
    192.168.1.101     server1.local
    192.168.1.102     server2.local
    

    /etc/hosts (server2)

    127.0.0.1         localhost server2.local
    192.168.1.101     server1.local
    192.168.1.102     server2.local
    

    Then set up the users:

    CREATE USER 'repl_user1'@'server1.local' IDENTIFIED BY 'password1';  // Server1
    CREATE USER 'repl_user2'@'server2.local' IDENTIFIED BY 'password2';  // Server2
    

    That should work so both servers receive connections from their own host and the other as well and map it to the correct users.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to set up multi node Cassandra cluster in a local network. I
I'm trying to set up a Jenkins multi configuration job for the selenium tests
Trying to set up a new project, and running into a weird issue. I
I'm trying to set up forms authentication across multiple servers and subdomains. I have
I'm trying to set up a multi-module Maven project, and the inter-module dependencies are
I am trying to create a multi-dimensional NetCDF file using the R package ncdf
I'm trying to create a multi-level editor in MVC3. By multi-level I mean that
I am trying to set up a multi-dimensional NSMutableArray . I am initially setting
I'm trying to set up a multi-select filter on a foreign key in the
Im trying to implement multi-language support in my system, the other systems at work

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.