# pt-online-schema changes for 2 different databases not working

**URL:** <https://forums.percona.com/t/pt-online-schema-changes-for-2-different-databases-not-working/5801>\
**Category:** Percona Toolkit\
**Created:** [August 9, 2017, 7:34am UTC](https://forums.percona.com/t/pt-online-schema-changes-for-2-different-databases-not-working/5801 "2017-08-09T07:34:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![chintoo02018](https://avatars.discourse-cdn.com/v4/letter/c/35a633/32.png) [@chintoo02018](https://forums.percona.com/u/chintoo02018)\
**Post date:** [August 9, 2017, 7:34am UTC](https://forums.percona.com/t/pt-online-schema-changes-for-2-different-databases-not-working/5801/1 "2017-08-09T07:34:09Z")

</div>

Below command only woks for same database name (synctest) on diffrent server.

```auto
pt-table-sync --execute h=xx.xx.xx.xxx -u synctest -p synctest ,D=synctest,t=a h=localhost,D=ptest,t=a 

```

need to sync table from synctest database to ptest dataabase

---

<div class="post-metadata">

**Author:** ![carlos.salguero](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/carlos.salguero/32/20_2.png) [@carlos.salguero](https://forums.percona.com/u/carlos.salguero)\
**Post date:** [August 9, 2017, 1:03pm UTC](https://forums.percona.com/t/pt-online-schema-changes-for-2-different-databases-not-working/5801/2 "2017-08-09T13:03:51Z")

</div>

Use the full DNS for both MySQL instances.  
I set up a local MySQL instance and started the sandbox.  
The I’ve synced encuestas.personas table using:

```auto
bin/pt-table-sync --execute h=127.1,P=3306,u=root,p=root,D=encuestas,t=personas h=127.1,P=12345,u=msandbox,p=msandbox,D=s1,t=personas 

```

---

<div class="post-metadata">

**Author:** ![chintoo02018](https://avatars.discourse-cdn.com/v4/letter/c/35a633/32.png) [@chintoo02018](https://forums.percona.com/u/chintoo02018)\
**Post date:** [August 10, 2017, 2:29am UTC](https://forums.percona.com/t/pt-online-schema-changes-for-2-different-databases-not-working/5801/3 "2017-08-10T02:29:40Z")

</div>

Thanks , Its work but below getting error , If we have to give super privilege to local user , or any bypass option

```auto

DBD::mysql::db do failed: Access denied; you need (at least one of) the SUPER privilege(s) for this operation [for Statement "/*!32316 SET SQL_LOG_BIN=0 */"]

```

Also check in log

```auto

48 Query SELECT &#64;&#64;SQL_MODE
48 Query SET &#64;&#64;SQL_QUOTE_SHOW_CREATE = 1/*!40101, &#64;&#64;SQL_MODE='NO_AUTO_VALUE_ON_ZERO,STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION'*/
48 Query /*!32316 SET SQL_LOG_BIN=0 */
48 Query /*!40101 SET &#64;&#64;SQL_MODE := CONCAT(&#64;&#64;SQL_MODE, ',NO_AUTO_VALUE_ON_ZERO')*/

```

Why there is need to give SUPER privileges for Source database , where only select command to be execute ?

---

<div class="post-metadata">

**Author:** ![carlos.salguero](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/carlos.salguero/32/20_2.png) [@carlos.salguero](https://forums.percona.com/u/carlos.salguero)\
**Post date:** [August 10, 2017, 6:39am UTC](https://forums.percona.com/t/pt-online-schema-changes-for-2-different-databases-not-working/5801/4 "2017-08-10T06:39:08Z")

</div>

It because it is changing the binlog format and you need SUPER privileges to do that.  
[url][https://dev.mysql.com/doc/refman/5.7/en/binary-log-setting.html[/url]](https://dev.mysql.com/doc/refman/5.7/en/binary-log-setting.html%5B/url%5D)

---

<div class="post-metadata">

**Author:** ![chintoo02018](https://avatars.discourse-cdn.com/v4/letter/c/35a633/32.png) [@chintoo02018](https://forums.percona.com/u/chintoo02018)\
**Post date:** [August 11, 2017, 10:06am UTC](https://forums.percona.com/t/pt-online-schema-changes-for-2-different-databases-not-working/5801/5 "2017-08-11T10:06:34Z")

</div>

There 2 issue found

1 - If SUPER Privileges required for Source then this directly security risk factor .  
2 - It gives EXIT Status =2 , Where shell script shows $?=2 and got failed , where ever there changes in data found .

```auto

# DELETE REPLACE INSERT UPDATE ALGORITHM START END EXIT DATABASE.TABLE
# 1 0 92 23 Chunk 20:59:07 20:59:30 2 DB.TBL

```

Can you report the issue for Further improvements
