Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><code>Replication-rewrite-db</code> usage is same as other replication options. Not only <code>Replication-rewrite-db</code> works on the default database, but these also: <code>replicate-do-db, replicate-ignore-db, binlog-do-db and binlog-ignore-db</code>. Refer <a href="http://dev.mysql.com/doc/refman/5.5/en/replication-options-slave.html" rel="nofollow noreferrer">this</a> and <a href="http://dev.mysql.com/doc/refman/5.5/en/replication-options-binary-log.html" rel="nofollow noreferrer">this</a>. </p> <p>There are real world purpose, else MySQL wouldn't have implemented this option. And it works only on default database <a href="http://dev.mysql.com/doc/refman/5.5/en/replication-options-slave.html" rel="nofollow noreferrer">because</a>-</p> <blockquote> <p>The main reason for this “check just the default database” behavior is that it is difficult from the statement alone to know whether it should be replicated (for example, if you are using multiple-table DELETE statements or multiple-table UPDATE statements that act across multiple databases). It is also faster to check only the default database rather than all databases if there is no need.</p> </blockquote> <p>You should also know the replication rules. From <a href="http://dev.mysql.com/doc/refman/5.5/en/replication-rules-db-options.html" rel="nofollow noreferrer">here</a>.</p> <p>I tested phpmyadmin by issuing <code>INSERT, DELETE and UPDATE</code> and noticed(By enabling <code>general_query_log</code>) that it issues <code>INIT DB 'db_name'</code>('Init DB' is logged for the <code>mysql_select_db()</code> API call).</p> <p>For example:</p> <pre><code>Init DB sakila 1 Query INSERT INTO `sakila`.`actor_info` (`actor_id`, `first_name`, `last_name`, `film_info`) VALUES ('1235', 'abc', 'efg', NULL) </code></pre> <p>So ultimately the replication shouldn't break as phpmyadmin does it correctly by executing USE db before every query.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload