{"id":9456,"date":"2017-02-07T09:39:47","date_gmt":"2017-02-07T08:39:47","guid":{"rendered":"https:\/\/thecamels.org\/co-to-jest-replikacja-mysql\/"},"modified":"2021-03-17T17:55:21","modified_gmt":"2021-03-17T16:55:21","slug":"what-is-mysql-replication","status":"publish","type":"post","link":"https:\/\/thecamels.org\/en\/what-is-mysql-replication\/","title":{"rendered":"What is MySQL replication?"},"content":{"rendered":"\n<p>MySQL is very popular as a database for many websites. Over time the database can grow to colossal size. Apart from storing page content (articles, comments, list of users), it also contains settings of the page or application itself. In this case, regular backup becomes a necessity. A large database is also a greater burden for the server, which has to cope with the management of millions of records. <strong>Replication<\/strong> can be a remedy for many of these problems.<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>MySQL database server provides a very interesting replication mechanism. What is it? In short, thanks to replication, each change on the master server leads to an identical change on the backup server (slave). Replication allows us to do that:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Scalability<\/strong> &#8211; it is possible to spread the load among many servers. Record saving and updating operations are performed on one server and data is downloaded and searched from another.<\/li><li><strong>Security<\/strong> &#8211; thanks to replication we create a clone of the existing production base. If it does not protect us from <code>DROP TABLE<\/code> operations, it can help in case of hardware failure of the main server. A replicated database is perfect for performing a traditional backup, without the need to stop the work of the main database.<\/li><li><strong>Analysis<\/strong> &#8211; complicated analytical operations, various conversions and statistical analyses can be performed on a separate server without the need to load the main database.<\/li><li><strong>Separation<\/strong> &#8211; we can share a clone production database for developers or testers to do their work on a copy of the database.<\/li><\/ul>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\"><p class=\"ez-toc-title\" style=\"cursor:inherit\">Spis tre\u015bci<\/p>\n<\/div><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/thecamels.org\/en\/what-is-mysql-replication\/#mysql-replication-mechanism\" >MySQL replication mechanism<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/thecamels.org\/en\/what-is-mysql-replication\/#types-of-replication\" >Types of replication<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/thecamels.org\/en\/what-is-mysql-replication\/#configuration\" >Configuration<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/thecamels.org\/en\/what-is-mysql-replication\/#replicating-a-selected-table\" >Replicating a selected table<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/thecamels.org\/en\/what-is-mysql-replication\/#typical-replication-problems\" >Typical replication problems<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/thecamels.org\/en\/what-is-mysql-replication\/#how-to-fix-the-replication\" >How to fix the replication?<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"mysql-replication-mechanism\"><\/span>MySQL replication mechanism<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Replication of MySQL data is based on a very simple rule. The master server keeps a kind of logbook in which it records every action it has performed. It uses bin-logs for this purpose. There are binary files containing instructions that the master has performed. The backup server (slave) reads this data and executes queries one by one, filling the database with subsequent records. The result of this work are two identical databases.<\/p>\n\n\n\n<p>Configuring the replication mechanism launches additional threads on the server side. An additional thread will appear on the master server (for each slave server), which is responsible for sending <code>bin-logs<\/code> to the slave servers.<\/p>\n\n\n\n<p>The backup server creates two threads. The first one, called <strong>I\/O Thread<\/strong>, is responsible for receiving the log from the main server. It saves them locally to disk in temporary files (<code>relay-log<\/code>). The second thread, called <strong>SQL Thread<\/strong>, parses these files and executes queries to the database.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"types-of-replication\"><\/span>Types of replication<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Three different methods of replication are available, which translates into a format of data stored in <code>bin-logs<\/code>. This is due to the <code>binlog_format<\/code> variable, which can be as follows: <code>ROW, STATEMENT, MIXED<\/code>. These methods are:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>SBR<\/strong> (<code>statement-based replication<\/code>) &#8211; in this mode, the server saves the queries it has made to the file. It was the only available mode before MySQL 5.1.4.<\/li><li><strong>RBR<\/strong> (<code>row-based replication<\/code>) &#8211; the results of the queries are stored in the bin logs on the master server. The information about the record that has been changed is stored.<\/li><li><strong>MFL<\/strong> (<code>mixed-format logging<\/code>) &#8211; it is a combination of the two above types of replications.<\/li><\/ul>\n\n\n\n<p>Each of the above methods has its advantages and disadvantages. The quickest method of replication is the use of <strong>SBR<\/strong> technology. The main server writes to the file the query it made, then the backup server reads and executes it. An example of such a query can be:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>DELETE FROM customers WHERE customerNumber = 495;<\/code><\/pre>\n\n\n\n<p>This method is very fast and efficient. Only SQL queries are saved to the log file. Unfortunately, this causes problems in the case of more complex queries or stored procedures. Imagine a query that uses random functions (<code>RAND()<\/code>). Replication of such a query will have a completely different result on the side of each backup server.<\/p>\n\n\n\n<p>The solution to this problem was the introduction of replication with the <strong>RBR<\/strong> method. In this case, the changes that occurred after the command was executed are stored in bin logs. Information on how to modify specific records is logged. Unfortunately, the method there is much slower than replication of queries. It also causes a significant increase in the amount of data sent between replicating servers. That&#8217;s why we created a <strong>mixed-format logging method<\/strong>.<\/p>\n\n\n\n<p>In this method, in most cases, SQL queries are logged as in the case of <strong>SBR<\/strong>, while for queries whose result is not predictable, <strong>RBR<\/strong> replication is enabled.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"configuration\"><\/span>Configuration<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>At the very beginning we will take care of the configuration of the master server. To do this, we need to edit the MySQL server configuration file. Most often it is <code>\/etc\/my.cnf<\/code> file. There should be such options as:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;mysqld]\nlog-bin = \/tmp\/mysql-bin\nbinlog_format = mixed\nmax_binlog_size = 50M\nserver-id = 1<\/code><\/pre>\n\n\n\n<p>Each option corresponds to a specific replication parameter:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>log-bin = \/tmp\/mysql-bin<\/strong> &#8211; activates the mechanism for logging changes in the database. These changes are stored in a file.<\/li><li><strong>binlog_format = mixed<\/strong> &#8211; sets the format for saving data to bin-logs. In this case it is a mixed format.<\/li><li><strong>max_binlog_size = 50M<\/strong> &#8211; the maximum logbook size.<\/li><li><strong>server-id<\/strong> &#8211; this number determines the unique server number within the replication mechanism.<\/li><\/ul>\n\n\n\n<p>There are also available, which allow us to replicate the selected database or table. By default, all databases and tables within the server will be cloned. The <strong>binlog-do-db=database<\/strong> option enforces replication of only selected databases.<\/p>\n\n\n\n<p>After restarting MySQL server, we log into it (<code>mysql -u root -p<\/code>) and issue the following SQL query. It should show us the status of the master server.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mysql&gt; SHOW MASTER STATUS\\G\n*************************** 1. row ***************************\n            File: mysql-bin.000003\n        Position: 106\n    Binlog_Do_DB: \nBinlog_Ignore_DB: \n1 row in set (0.00 sec)\n\nmysql&gt;<\/code><\/pre>\n\n\n\n<p>Now you need to create a user who will be responsible for the authorization of backup servers. To do this, we issue a SQL query:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>CREATE USER 'repuser'@'%' IDENTIFIED BY 'haslo';\nGRANT REPLICATION SLAVE ON *.* TO 'repuser'@'%' IDENTIFIED BY 'haslo';<\/code><\/pre>\n\n\n\n<p>Now is the time to configure the slave server. Most often it&#8217;s <code>\/etc\/my.cnf<\/code> file. It should have the options as below. They do not apply to MySQL 5.5 or later. For them we set the replication using the SQL statement.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>server-id=2\nmaster-host=192.168.0.164\nmaster-user=repuser\nmaster-password=haslo\nmaster-connect-retry=30<\/code><\/pre>\n\n\n\n<p>For MySQL 5.5 and above:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>CHANGE MASTER TO MASTER_HOST='192.168.0.164',\nMASTER_USER='repuser',\nMASTER_PASSWORD='haslo';<\/code><\/pre>\n\n\n\n<p>We connect the client to the server and give a command that will load the first portion of data from the main server and then stop the replication.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mysql&gt; LOAD DATA FROM MASTER;\nQuery OK, 0 rows affected, 1 warning (0.34 sec)\nmysql&gt; SLAVE STOP;\nQuery OK, 0 rows affected (0.00 sec)<\/code><\/pre>\n\n\n\n<p>The next step is to set the replication parameters. We publish a SQL query:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>CHANGE MASTER TO\nMASTER_HOST='192.168.0.164',\nMASTER_LOG_FILE='mysql-bin.000003',\nMASTER_LOG_POS=1274;<\/code><\/pre>\n\n\n\n<p><code>MASTER_LOG_FILE<\/code> and <code>MASTER_LOG_POS<\/code> values are taken from the <code>SHOW MASTER STATUS<\/code> command issued on the main server side. Now we can turn on the replication and check its status.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mysql&gt; START SLAVE;\nQuery OK, 0 rows affected, 1 warning (0.00 sec)\n\nmysql&gt; SHOW SLAVE STATUS\\G;\n*************************** 1. row ***************************\n               Slave_IO_State: Waiting for master to send event\n                  Master_Host: 192.168.0.164\n                  Master_User: repuser\n                  Master_Port: 3306\n                Connect_Retry: 30\n              Master_Log_File: mysql-bin.000003\n          Read_Master_Log_Pos: 1274\n               Relay_Log_File: mysqld-relay-bin.000002\n                Relay_Log_Pos: 251\n        Relay_Master_Log_File: mysql-bin.000003\n             Slave_IO_Running: Yes\n            Slave_SQL_Running: Yes\n              Replicate_Do_DB: \n          Replicate_Ignore_DB: \n           Replicate_Do_Table: \n       Replicate_Ignore_Table: \n      Replicate_Wild_Do_Table: \n  Replicate_Wild_Ignore_Table: \n                   Last_Errno: 0\n                   Last_Error: \n                 Skip_Counter: 0\n          Exec_Master_Log_Pos: 1274\n              Relay_Log_Space: 407\n              Until_Condition: None\n               Until_Log_File: \n                Until_Log_Pos: 0\n           Master_SSL_Allowed: No\n           Master_SSL_CA_File: \n           Master_SSL_CA_Path: \n              Master_SSL_Cert: \n            Master_SSL_Cipher: \n               Master_SSL_Key: \n        Seconds_Behind_Master: 0\nMaster_SSL_Verify_Server_Cert: No\n                Last_IO_Errno: 0\n                Last_IO_Error: \n               Last_SQL_Errno: 0\n               Last_SQL_Error: \n1 row in set (0.00 sec)\n\nERROR: \nNo query specified\n\nmysql&gt;<\/code><\/pre>\n\n\n\n<p>The replication should work well.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"replicating-a-selected-table\"><\/span>Replicating a selected table<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>MySQL allows you to replicate a selected table, database or exclude it from replication. Parameters are responsible for this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>replicate-do-db\nreplicate-ignore-db\nreplicate-do-table\nreplicate-ignore-table\nreplicate-wild-do-table\nreplicate-wild-ignore-table\nbinlog-do-db\nbinlog-ignore-db<\/code><\/pre>\n\n\n\n<p>In theory, they allow you to filter what is replicated. We can replicate or not selected table, database and several tables using wildcards. Filtering can be set at the binog level (<code>binlog-do-db, binlog-ignore-db<\/code>). We then define what data goes into the files at all.<\/p>\n\n\n\n<p>In practice it is no longer so colourful. Imagine that we have set the option: <code>replicate-ignore-db=sales<\/code>. This means that we do not want to replicate the sales database.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>USE prices;\nUPDATE sales.january SET amount=amount+1000;<\/code><\/pre>\n\n\n\n<p>In this case, the inquiry will be replicated. Why? MySQL filtering only takes into account the setting of the active database using the USE command; therefore, if we refer to the database using the database_data.table syntax, the MySQL filter will not catch such a reference and will replicate the query.<\/p>\n\n\n\n<p>Therefore, it is not recommended to use this type of functionality, if we are not sure what queries go to the database. It may turn out that a nicely configured replication will suddenly arise due to this type of problem.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"typical-replication-problems\"><\/span>Typical replication problems<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Many administrators believe that replication will replace the need for data backup. We can use it for backups. Thanks to this, the backup is taken from one of the backup servers, without burdening the production-running main server. You can even shut down the slave server for a while, back up the files and then restart it.<\/p>\n\n\n\n<p>Unfortunately, the replicated database will not protect us from all kinds of queries that delete records, tables or databases. Queries like <code>TRUNCATE TABLE<\/code> or <code>DROP TABLE<\/code>, will be very quickly transferred to the backup server and delete our backup. To avoid such situations, we can use the command <code>CHANGE MASTER TO MASTER_DELAY = N;<\/code>. This will delay the replication of data by N seconds. This may prevent us from deleting data on the backup server side.<\/p>\n\n\n\n<p>Replication protects us from physical damage to the main server. In this case we can switch our application to a backup database.<\/p>\n\n\n\n<p>One of the most important features for MySQL replication is that it is <strong>asynchronous<\/strong>. This does not give us any guarantee that any operation on the main database, they were sent and saved on the backup databases. It may happen that we have a great bad luck and shortly after the completion of the transaction, the main server switches off. Our application switches to a backup database. Unfortunately, the second database did not manage to replicate.<\/p>\n\n\n\n<p>The solution to such problems is a semisynchronous replication. It was added quite recently in MySQL 5.5. After the COMMIT command is executed, the data is sent to the backup server. It saves the data to log relations. As soon as it saves all received data, it sends a confirmation to the master server. When the master server receives information from at least one slave server, the transaction is considered completed. Of course, such a solution affects the performance of the main database, which must wait for answers from the backup server.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"how-to-fix-the-replication\"><\/span>How to fix the replication?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>It will happen to us many times that the slave server stops replicating the data. There can be many reasons for this, but the most common reason for stopping replication is an erroneous SQL query that cannot be executed. Checking the status of the whole mechanism we will see:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Slave_IO_Running: Yes\nSlave_SQL_Running: No<\/code><\/pre>\n\n\n\n<p>This means that the thread downloading data from the master server works, but the thread that should load it to the database for some reason has been disabled. Below we will also see the reason why this thread has stopped.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Last_Error: Error 'Cannot add or update a child row: a foreign key constraint fails (`cms`.`comment_replies`, CONSTRAINT `comment_replies_12` FOREIGN KEY (`comment_id`) REFERENCES `comments` (`id`) ON DELETE CASCADE)' on query. Default database: 'cms'. Query: 'INSERT INTO comment_replies (`ID`,`FILE_ID`,`RECIPIENT_ID`,`COMMENT_ID`,`PROFILE_ID`,`CREATED`,`NUMBER`,`AUTHOR`,`TEXT`) VALUES (NULL,5236,2466656,'1133',454,1303150999,1,'Lorem Ipsum','Proin vel nulla vel nisi eleifend rhoncus dignissim vitae nulla. Quisque odio nibh.')<\/code><\/pre>\n\n\n\n<p>The replication should stop by itself, but to be sure, execute the command:STOP SLAVE;. Now we can manually correct the database, e.g. by adding a missing element in another array, creating a table, and so on. We can always execute a command that allows us to bypass an erroneous query:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mysql&gt; SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;<\/code><\/pre>\n\n\n\n<p>Now all that remains is to turn on the replication with the help of replication: <code>START SLAVE;<\/code>.<\/p>\n\n\n\n<p>Database replication mechanism is a very interesting solution. Before its implementation into production conditions, it is necessary to pay attention to a few shortcomings. It is worth testing the implementation of this mechanism in various situations in order to avoid unpleasant surprises.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>MySQL is very popular as a database for many websites. Over time the database can grow to colossal size. Apart from storing page content (articles, comments, list of users), it also contains settings of the page or application itself. In this case, regular backup becomes a necessity. A large database is also a greater burden&hellip;<\/p>\n","protected":false},"author":1,"featured_media":16963,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[150],"tags":[699,707],"class_list":["post-9456","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","tag-server-administration","tag-servers"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>What is MySQL replication? - Thecamels.org<\/title>\n<meta name=\"description\" content=\"Learn what MySQL replication is, how it works and why it is done. Visit our blog!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/thecamels.org\/en\/what-is-mysql-replication\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What is MySQL replication? - Thecamels.org\" \/>\n<meta property=\"og:description\" content=\"Learn what MySQL replication is, how it works and why it is done. Visit our blog!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/thecamels.org\/en\/what-is-mysql-replication\/?utm_source=dark&amp;utm_medium=social&amp;utm_campaign=open-graph\" \/>\n<meta property=\"og:site_name\" content=\"Thecamels.org\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/thecamels.org\/\" \/>\n<meta property=\"article:published_time\" content=\"2017-02-07T08:39:47+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-03-17T16:55:21+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/thecamels.org\/wp-content\/uploads\/2017\/02\/29.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"627\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Kamil Porembi\u0144ski\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/thecamels.org\/wp-content\/uploads\/2017\/02\/29.png\" \/>\n<meta name=\"twitter:creator\" content=\"@thecamelsorg\" \/>\n<meta name=\"twitter:site\" content=\"@thecamelsorg\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Kamil Porembi\u0144ski\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/thecamels.org\\\/en\\\/what-is-mysql-replication\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/thecamels.org\\\/en\\\/what-is-mysql-replication\\\/\"},\"author\":{\"name\":\"Kamil Porembi\u0144ski\",\"@id\":\"https:\\\/\\\/thecamels.org\\\/en\\\/#\\\/schema\\\/person\\\/b7bd2aec5f506a68323eb40c86d38a32\"},\"headline\":\"What is MySQL replication?\",\"datePublished\":\"2017-02-07T08:39:47+00:00\",\"dateModified\":\"2021-03-17T16:55:21+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/thecamels.org\\\/en\\\/what-is-mysql-replication\\\/\"},\"wordCount\":1722,\"publisher\":{\"@id\":\"https:\\\/\\\/thecamels.org\\\/en\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/thecamels.org\\\/en\\\/what-is-mysql-replication\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/thecamels.org\\\/wp-content\\\/uploads\\\/2017\\\/02\\\/30.png\",\"keywords\":[\"server administration\",\"servers\"],\"articleSection\":[\"Blog\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/thecamels.org\\\/en\\\/what-is-mysql-replication\\\/\",\"url\":\"https:\\\/\\\/thecamels.org\\\/en\\\/what-is-mysql-replication\\\/\",\"name\":\"What is MySQL replication? - Thecamels.org\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/thecamels.org\\\/en\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/thecamels.org\\\/en\\\/what-is-mysql-replication\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/thecamels.org\\\/en\\\/what-is-mysql-replication\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/thecamels.org\\\/wp-content\\\/uploads\\\/2017\\\/02\\\/30.png\",\"datePublished\":\"2017-02-07T08:39:47+00:00\",\"dateModified\":\"2021-03-17T16:55:21+00:00\",\"description\":\"Learn what MySQL replication is, how it works and why it is done. Visit our blog!\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/thecamels.org\\\/en\\\/what-is-mysql-replication\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/thecamels.org\\\/en\\\/what-is-mysql-replication\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/thecamels.org\\\/en\\\/what-is-mysql-replication\\\/#primaryimage\",\"url\":\"https:\\\/\\\/thecamels.org\\\/wp-content\\\/uploads\\\/2017\\\/02\\\/30.png\",\"contentUrl\":\"https:\\\/\\\/thecamels.org\\\/wp-content\\\/uploads\\\/2017\\\/02\\\/30.png\",\"width\":1200,\"height\":627,\"caption\":\"Co to jest replikacja MySQL?\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/thecamels.org\\\/en\\\/what-is-mysql-replication\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"[HOME]\",\"item\":\"https:\\\/\\\/thecamels.org\\\/en\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Blog\",\"item\":\"https:\\\/\\\/thecamels.org\\\/en\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"What is MySQL replication?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/thecamels.org\\\/en\\\/#website\",\"url\":\"https:\\\/\\\/thecamels.org\\\/en\\\/\",\"name\":\"Thecamels.org\",\"description\":\"Hosting SSD NVMe z certyfikatem SSL i HTTP\\\/2. Administracja serwerami, skalowanie infrastruktury. Mamy g\u0142ow\u0119 do serwer\u00f3w i zadbamy o Twoj\u0105 stron\u0119 w sieci.\",\"publisher\":{\"@id\":\"https:\\\/\\\/thecamels.org\\\/en\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/thecamels.org\\\/en\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/thecamels.org\\\/en\\\/#organization\",\"name\":\"Thecamels\",\"url\":\"https:\\\/\\\/thecamels.org\\\/en\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/thecamels.org\\\/en\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/thecamels.org\\\/wp-content\\\/uploads\\\/2018\\\/09\\\/TC-logo-nowe.png\",\"contentUrl\":\"https:\\\/\\\/thecamels.org\\\/wp-content\\\/uploads\\\/2018\\\/09\\\/TC-logo-nowe.png\",\"width\":826,\"height\":106,\"caption\":\"Thecamels\"},\"image\":{\"@id\":\"https:\\\/\\\/thecamels.org\\\/en\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/thecamels.org\\\/\",\"https:\\\/\\\/x.com\\\/thecamelsorg\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/the-camels\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UC01xYBZbIAApTuPWuqgGE4Q\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/thecamels.org\\\/en\\\/#\\\/schema\\\/person\\\/b7bd2aec5f506a68323eb40c86d38a32\",\"name\":\"Kamil Porembi\u0144ski\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b2d40949e6453ecdd7663e9a61fac171f31810a28bdc5be0c4d7eca89f41571?s=96&d=identicon&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b2d40949e6453ecdd7663e9a61fac171f31810a28bdc5be0c4d7eca89f41571?s=96&d=identicon&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b2d40949e6453ecdd7663e9a61fac171f31810a28bdc5be0c4d7eca89f41571?s=96&d=identicon&r=g\",\"caption\":\"Kamil Porembi\u0144ski\"},\"description\":\"Architekt systemowy, administrator Linux, a czasem Windows. Lubi tematyk\u0119 security. Obecnie w\u0142a\u015bciciel firmy thecamels.org, zajmuj\u0105cej si\u0119 projektowaniem system\u00f3w o wysokiej dost\u0119pno\u015bci. Zajmuje si\u0119 skalowaniem du\u017cych aplikacji internetowych, wspieraniem startup\u00f3w w kwestiach serwerowych. Po godzinach zajmuje si\u0119 \u017ceglowaniem po morzach, lataniem, fotografi\u0105 i podr\u00f3\u017cami.\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What is MySQL replication? - Thecamels.org","description":"Learn what MySQL replication is, how it works and why it is done. Visit our blog!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/thecamels.org\/en\/what-is-mysql-replication\/","og_locale":"en_US","og_type":"article","og_title":"What is MySQL replication? - Thecamels.org","og_description":"Learn what MySQL replication is, how it works and why it is done. Visit our blog!","og_url":"https:\/\/thecamels.org\/en\/what-is-mysql-replication\/?utm_source=dark&utm_medium=social&utm_campaign=open-graph","og_site_name":"Thecamels.org","article_publisher":"https:\/\/www.facebook.com\/thecamels.org\/","article_published_time":"2017-02-07T08:39:47+00:00","article_modified_time":"2021-03-17T16:55:21+00:00","og_image":[{"width":1200,"height":627,"url":"https:\/\/thecamels.org\/wp-content\/uploads\/2017\/02\/29.png","type":"image\/png"}],"author":"Kamil Porembi\u0144ski","twitter_card":"summary_large_image","twitter_image":"https:\/\/thecamels.org\/wp-content\/uploads\/2017\/02\/29.png","twitter_creator":"@thecamelsorg","twitter_site":"@thecamelsorg","twitter_misc":{"Written by":"Kamil Porembi\u0144ski","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/thecamels.org\/en\/what-is-mysql-replication\/#article","isPartOf":{"@id":"https:\/\/thecamels.org\/en\/what-is-mysql-replication\/"},"author":{"name":"Kamil Porembi\u0144ski","@id":"https:\/\/thecamels.org\/en\/#\/schema\/person\/b7bd2aec5f506a68323eb40c86d38a32"},"headline":"What is MySQL replication?","datePublished":"2017-02-07T08:39:47+00:00","dateModified":"2021-03-17T16:55:21+00:00","mainEntityOfPage":{"@id":"https:\/\/thecamels.org\/en\/what-is-mysql-replication\/"},"wordCount":1722,"publisher":{"@id":"https:\/\/thecamels.org\/en\/#organization"},"image":{"@id":"https:\/\/thecamels.org\/en\/what-is-mysql-replication\/#primaryimage"},"thumbnailUrl":"https:\/\/thecamels.org\/wp-content\/uploads\/2017\/02\/30.png","keywords":["server administration","servers"],"articleSection":["Blog"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/thecamels.org\/en\/what-is-mysql-replication\/","url":"https:\/\/thecamels.org\/en\/what-is-mysql-replication\/","name":"What is MySQL replication? - Thecamels.org","isPartOf":{"@id":"https:\/\/thecamels.org\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/thecamels.org\/en\/what-is-mysql-replication\/#primaryimage"},"image":{"@id":"https:\/\/thecamels.org\/en\/what-is-mysql-replication\/#primaryimage"},"thumbnailUrl":"https:\/\/thecamels.org\/wp-content\/uploads\/2017\/02\/30.png","datePublished":"2017-02-07T08:39:47+00:00","dateModified":"2021-03-17T16:55:21+00:00","description":"Learn what MySQL replication is, how it works and why it is done. Visit our blog!","breadcrumb":{"@id":"https:\/\/thecamels.org\/en\/what-is-mysql-replication\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/thecamels.org\/en\/what-is-mysql-replication\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/thecamels.org\/en\/what-is-mysql-replication\/#primaryimage","url":"https:\/\/thecamels.org\/wp-content\/uploads\/2017\/02\/30.png","contentUrl":"https:\/\/thecamels.org\/wp-content\/uploads\/2017\/02\/30.png","width":1200,"height":627,"caption":"Co to jest replikacja MySQL?"},{"@type":"BreadcrumbList","@id":"https:\/\/thecamels.org\/en\/what-is-mysql-replication\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"[HOME]","item":"https:\/\/thecamels.org\/en\/"},{"@type":"ListItem","position":2,"name":"Blog","item":"https:\/\/thecamels.org\/en\/blog\/"},{"@type":"ListItem","position":3,"name":"What is MySQL replication?"}]},{"@type":"WebSite","@id":"https:\/\/thecamels.org\/en\/#website","url":"https:\/\/thecamels.org\/en\/","name":"Thecamels.org","description":"Hosting SSD NVMe z certyfikatem SSL i HTTP\/2. Administracja serwerami, skalowanie infrastruktury. Mamy g\u0142ow\u0119 do serwer\u00f3w i zadbamy o Twoj\u0105 stron\u0119 w sieci.","publisher":{"@id":"https:\/\/thecamels.org\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/thecamels.org\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/thecamels.org\/en\/#organization","name":"Thecamels","url":"https:\/\/thecamels.org\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/thecamels.org\/en\/#\/schema\/logo\/image\/","url":"https:\/\/thecamels.org\/wp-content\/uploads\/2018\/09\/TC-logo-nowe.png","contentUrl":"https:\/\/thecamels.org\/wp-content\/uploads\/2018\/09\/TC-logo-nowe.png","width":826,"height":106,"caption":"Thecamels"},"image":{"@id":"https:\/\/thecamels.org\/en\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/thecamels.org\/","https:\/\/x.com\/thecamelsorg","https:\/\/www.linkedin.com\/company\/the-camels","https:\/\/www.youtube.com\/channel\/UC01xYBZbIAApTuPWuqgGE4Q"]},{"@type":"Person","@id":"https:\/\/thecamels.org\/en\/#\/schema\/person\/b7bd2aec5f506a68323eb40c86d38a32","name":"Kamil Porembi\u0144ski","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4b2d40949e6453ecdd7663e9a61fac171f31810a28bdc5be0c4d7eca89f41571?s=96&d=identicon&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4b2d40949e6453ecdd7663e9a61fac171f31810a28bdc5be0c4d7eca89f41571?s=96&d=identicon&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4b2d40949e6453ecdd7663e9a61fac171f31810a28bdc5be0c4d7eca89f41571?s=96&d=identicon&r=g","caption":"Kamil Porembi\u0144ski"},"description":"Architekt systemowy, administrator Linux, a czasem Windows. Lubi tematyk\u0119 security. Obecnie w\u0142a\u015bciciel firmy thecamels.org, zajmuj\u0105cej si\u0119 projektowaniem system\u00f3w o wysokiej dost\u0119pno\u015bci. Zajmuje si\u0119 skalowaniem du\u017cych aplikacji internetowych, wspieraniem startup\u00f3w w kwestiach serwerowych. Po godzinach zajmuje si\u0119 \u017ceglowaniem po morzach, lataniem, fotografi\u0105 i podr\u00f3\u017cami."}]}},"_links":{"self":[{"href":"https:\/\/thecamels.org\/en\/wp-json\/wp\/v2\/posts\/9456","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thecamels.org\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thecamels.org\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thecamels.org\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thecamels.org\/en\/wp-json\/wp\/v2\/comments?post=9456"}],"version-history":[{"count":5,"href":"https:\/\/thecamels.org\/en\/wp-json\/wp\/v2\/posts\/9456\/revisions"}],"predecessor-version":[{"id":16751,"href":"https:\/\/thecamels.org\/en\/wp-json\/wp\/v2\/posts\/9456\/revisions\/16751"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/thecamels.org\/en\/wp-json\/wp\/v2\/media\/16963"}],"wp:attachment":[{"href":"https:\/\/thecamels.org\/en\/wp-json\/wp\/v2\/media?parent=9456"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thecamels.org\/en\/wp-json\/wp\/v2\/categories?post=9456"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thecamels.org\/en\/wp-json\/wp\/v2\/tags?post=9456"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}