ALTER PUBLICATION

Description

ALTER PUBLICATION can change the attributes of a publication.

You must own the publication to use ALTER PUBLICATION. Adding a table to a publication additionally requires owning that table.

Syntax

  1. ALTER PUBLICATION pubname ACCOUNT 
  2. { ALL
  3. | account_name, [, ... ]
  4. | ADD account_name, [, ... ]
  5. | DROP account_name, [, ... ]
  6. [ COMMENT 'string']

Explanations

  • pubname: The name of an existing publication whose definition is to be altered.
  • account_name: The user name of the owner of the publication.

Examples

  1. create account acc0 admin_name 'root' identified by '111';
  2. create account acc1 admin_name 'root' identified by '111';
  3. create account acc2 admin_name 'root' identified by '111';
  4. create database t;
  5. create publication pub3 database t account acc0,acc1;
  6. mysql> alter publication pub3 account add accx;
  7. show create publication pub3;
  8. Query OK, 0 rows affected (0.00 sec)
  9. mysql> show create publication pub3;
  10. +-------------+-----------------------------------------------------------------------+
  11. | Publication | Create Publication |
  12. +-------------+-----------------------------------------------------------------------+
  13. | pub3 | CREATE PUBLICATION `pub3` DATABASE `t` ACCOUNT `acc0`, `acc1`, `accx` |
  14. +-------------+-----------------------------------------------------------------------+
  15. 1 row in set (0.01 sec)
  16. mysql> show publications;
  17. +------+----------+
  18. | Name | Database |
  19. +------+----------+
  20. | pub3 | t |
  21. +------+----------+
  22. 1 row in set (0.00 sec)