How to Set up Master Slave Replication in MySQL: Hands-on!

Поділитися
Вставка
  • Опубліковано 20 січ 2025

КОМЕНТАРІ • 64

  • @CodingX
    @CodingX  4 роки тому +1

    Hi everyone, If you have any doubts on this video please comment below. Subscribe and stay tuned to get the latest video on #Web Server configuration, #AWS, #Cloud Computing, and many more every week.

  • @davek6693
    @davek6693 3 роки тому +5

    Awesome tutorial, actually the only one which i came across that works. I really struggled with replication before this video. Thankyou

  • @kirpalshergill
    @kirpalshergill Рік тому +1

    Hello mate, I'm absolutely new to it. Let me start by first asking how to open two tabs and which Mysql are you writing this code on? thabks

  • @Smaranns
    @Smaranns 3 роки тому +1

    Good tutorial worked for me for an azure master-slave replication
    Thanks

  • @edwardferguson1872
    @edwardferguson1872 3 роки тому

    This video was very helpful. Thank you!

  • @gauravswarankar2557
    @gauravswarankar2557 2 місяці тому

    what if i want to create table dynamically inside db?

  • @ashiqmumtaz8726
    @ashiqmumtaz8726 2 роки тому

    is there any way that we can set the slave's server-id by master?

  • @Swamysharanamayyappa
    @Swamysharanamayyappa 2 роки тому

    Can you explain performance tuning and query optimzation in mysql

  • @Smaranns
    @Smaranns 3 роки тому

    i need to do it for another database now,
    I tried to change the mysqld.cnf file and change the bin log db..
    but when i check the show master status it stil shows the old db name.

  • @olumidemichael5049
    @olumidemichael5049 2 роки тому

    Thank you! this helped

  • @Singh7e7
    @Singh7e7 4 роки тому +1

    Amazing. Great stuff! Always wanted to learn master slave.

  • @aathifmohomed6329
    @aathifmohomed6329 Рік тому

    after final command the reply file say as not permission to do.. please help

  • @ddrr9388
    @ddrr9388 8 місяців тому

    how to open the master server and slave server

  • @AsimKhan13
    @AsimKhan13 3 роки тому

    i have setup Mysql Master slave replication, i checked the replication was working fine and today i have this error on SLAVE : Error 'Unknown database 'pgdb'' on query. Default database: 'pgdb'. Query: 'alter table pg_log add partition (partition p20211005 values less than ('2021-10-05'))'

  • @ranvijaymehta
    @ranvijaymehta 3 роки тому +1

    Why Database created ? unnecessary new user will be confuse.

  • @nexus718
    @nexus718 4 роки тому

    Hi, sir just wanted to ask could this setup work for slave localhost and master VPS?

  • @srinathrao413
    @srinathrao413 3 роки тому

    I followed same instruction step by step... but after inserting a new row in master system is just hanging Its neither inserted nor showing the same record in Slave... Is there anything to do with port openening of mysql (3306)... i am checking out this in Azure , Ubuntu , 18.x . Please help.

    • @CodingX
      @CodingX  3 роки тому

      First check why it's not inserting into master. Slave will take from the log, master is not pushing the data to slave, so it should insert into master first. Then you will check it's updating or not in slave.

  • @pritikashyap457
    @pritikashyap457 4 роки тому

    Hi, sir have you any video to create mysql configuration file like inside this path - nano/etc/mysql/mysql.conf/mysqld ...
    Actually i want to know how we can create this (mysql.conf and mysqld) file initially.

    • @CodingX
      @CodingX  4 роки тому

      I think, no need to create config file, it is already there you need to just edit as per your need.

  • @pandeyumesh1569
    @pandeyumesh1569 3 роки тому +1

    Hi Team,
    Can any one suggest ..
    How to change replication filter in multi source Replication ..
    i.e.
    Chainal-1 replicate DB1.table1,
    Channel-2 replicate DB2.table2
    Every chainal replicate spacific databases not all data bases ..

    • @CodingX
      @CodingX  3 роки тому

      Sorry, umesh, I haven't that. Will let you know if I got something.

  • @paulousstudio9140
    @paulousstudio9140 3 роки тому

    When I try to create the same database for slave, the shell throws back "Database already exists". Note i am running (testing) on a local machine.

    • @CodingX
      @CodingX  3 роки тому +1

      It won't work on local machine

    • @paulousstudio9140
      @paulousstudio9140 3 роки тому

      @@CodingX Would you care to explain why is that so?I noticed you used 0.0.0.0 for your IP, if you were running it on a remote server why didn't you pass that IP?

    • @CodingX
      @CodingX  3 роки тому +1

      @@paulousstudio9140 0.0.0.0 is wild IP, it means the server can accept any IP. to replicate, you need two servers

    • @paulousstudio9140
      @paulousstudio9140 3 роки тому

      Alright thank you very much

  • @rishabhchd19
    @rishabhchd19 4 роки тому

    Hi, good tutorial. How to sync both servers so that any change is written to SLAVE also reflect to Master?

    • @CodingX
      @CodingX  4 роки тому +1

      You have to achieve this by the distributed database system.

    • @rishabhchd19
      @rishabhchd19 4 роки тому

      @@CodingX any video on that?

    • @CodingX
      @CodingX  4 роки тому

      @@rishabhchd19 not yet.

    • @nissyj836
      @nissyj836 3 роки тому

      @rishabh : did you achieve ?

    • @MaxPayne-o8f
      @MaxPayne-o8f 3 роки тому

      To achieve that you must Setup a master - master relationship between your mysql servers.

  • @aeonzeon1344
    @aeonzeon1344 3 роки тому

    thanks sir i setup my linux to linux perfectly... sir ask for merge replication tutorials

  • @saurabhtiwari-kg9vn
    @saurabhtiwari-kg9vn 3 роки тому

    Plz help 🙏 I search on whole internet but i can't find any solution... after auditing mysql slave replication error 1032 occurs if you have any idea please guide me,i tried all skipping method but yet same error occur

    • @CodingX
      @CodingX  3 роки тому

      The error indicates that the master deletes a row but when the slave try to do the same, it cannot find it in its database.
      That means, replication was not working or you hadn't put the same data in slave as master while setting up the slave.
      For this one solution is, do the all step again.

    • @saurabhtiwari-kg9vn
      @saurabhtiwari-kg9vn 3 роки тому

      @@CodingX We have give the access of portal to our client so we can't do the steps again in master database.Please suggest any other method to solve this issue.🙏

  • @veladisravankumar2635
    @veladisravankumar2635 3 роки тому

    Thank you, actually I am looking about this concept.
    My requirement is "Am going to setup Disaster recovery of Mysql for production. It means if any thing happens for my master database, I need to switch db from master to slave in application. To achieve this, I have setup 2 mysql instances in AWS(master) and GCP(slave)".Is it work bw 2 clouds ? and after setup successful this configuration, if any problem in slave will it effect to master ? (ex: If slave shutdown suddenly, should not effect to master db because it's main production).
    Please provide your suggestions....Thanks in advance

    • @CodingX
      @CodingX  3 роки тому +1

      Yes, it will work in 2 clouds and if master is affected then you can switch to slave. If slave affected, it doesn't affect to master.

    • @veladisravankumar2635
      @veladisravankumar2635 3 роки тому

      @@CodingX Thank you, am trying it now

    • @veladisravankumar2635
      @veladisravankumar2635 3 роки тому

      @@CodingX Thank You, It's working fine to me. My doubt is, we pointed one binlog file name to slave db. But after few days running mysql, new binlog files will generate ? then how it will work. Out pointed binlog will be old one. Please give your suggestions..

    • @veladisravankumar2635
      @veladisravankumar2635 3 роки тому

      please provide your suggestions

    • @CodingX
      @CodingX  3 роки тому

      @@veladisravankumar2635 MySQL keeping the track of log files, if you create slave it's always keep tracking of master log.

  • @amitbhattacharyya5925
    @amitbhattacharyya5925 3 роки тому

    i have one question , if i read from master does the read operation shared between slaves or application has to connect each slave db separately, specifically for read.

  • @tanhoang5611
    @tanhoang5611 4 роки тому

    so how to create another server with an IP. Can you help me with that?

    • @CodingX
      @CodingX  4 роки тому

      Can you elaborate? what exactly you want to do?

    • @tanhoang5611
      @tanhoang5611 4 роки тому

      @@CodingX I have a problem that I want to set master-slave replication on the same computer. So how can I create two server: master and slave like you did.

    • @CodingX
      @CodingX  4 роки тому

      @@tanhoang5611 Then why do you need master-slave? You can directly access same DB right?

  • @harapriyasahoo7029
    @harapriyasahoo7029 2 роки тому

    Great video and my doubt was correct the guy behind the video is an Odia… not from name but from pronunciation….

  • @Think_Divine
    @Think_Divine 3 роки тому

    How you find out master ip address I. e 3.14.135.5 ?

    • @CodingX
      @CodingX  3 роки тому +1

      This is your server IP where you hosted application

    • @Think_Divine
      @Think_Divine 3 роки тому

      @@CodingX ok. How can I find out that?

  • @bilalmajeed6122
    @bilalmajeed6122 Рік тому

    Thank you for wasting my 2 hours, I knew this, by your vocabulary but still I thought to follow along with you, such a shame.
    Slave_IO_State: Connecting to source - you have this same issue but you didn't address it.
    Slave_IO_Running: Connecting
    THank you again.

  • @Vikaskumar-ur5di
    @Vikaskumar-ur5di 4 роки тому

    please created same video on hindi language

    • @CodingX
      @CodingX  4 роки тому

      Thank you, I will make same video on Hindi

    • @Vikaskumar-ur5di
      @Vikaskumar-ur5di 4 роки тому

      @@CodingX i need this type of video in hindi language

  • @aditidas3572
    @aditidas3572 2 роки тому

    Getting Slave_IO_Running in Connecting state, please suggest why? tried many times!! :(