Frage

I tried to add unique index to 2 columns of an RDS DB table with pt-online-schema-change and it failed with the error like:

DBD::mysql::db do failed: Access denied; you need (at least one of) the SUPER privilege(s) for this operation [for Statement "SET SQL_LOG_BIN=0"] at /usr/bin/pt-online-schema-change line 4663.

But using oak-online-alter-table, my table is altering. The procedure is not completed, but I see no errors and the output is like:

...
-- Copying range (1230004), (1231683), progress: 24%

Do these tools implement different approaches to alter tables?

War es hilfreich?

Lösung

There is nothing to really worry about in this instance.

According to the MySQL Documentation on the SUPER privilege

The SUPER privilege enables an account to use CHANGE MASTER TO, KILL or mysqladmin kill to kill threads belonging to other accounts (you can always kill your own threads), PURGE BINARY LOGS, configuration changes using SET GLOBAL to modify global system variables, the mysqladmin debug command, enabling or disabling logging, performing updates even if the read_only system variable is enabled, starting and stopping replication on slave servers, specification of any account in the DEFINER attribute of stored programs and views, and enables you to connect (once) even if the connection limit controlled by the max_connections system variable is reached.

To create or alter stored functions if binary logging is enabled, you may also need the SUPER privilege, as described in Section 18.7, “Binary Logging of Stored Programs”.

Disabling the binary logging of statements in a DB Session requires the SUPER privilege.

In fact, according to the documentation on pt-online-schema-change

--bin-log

Allow binary logging (SET SQL_LOG_BIN=1). By default binary logging is turned off because in most cases the --tmp-table does not need to be replicated. Also, performing an online schema change in a replication environment requires careful planning else replication may be broken; see “REPLICATION”.

From this, you can conclude that this is indeed normal behavior for pt-online-schema-change. It attempted to disable binary logging in its session by default.

Recommendation

Try running pt-online-schema-change as root@localhost. That user should all privs active.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top