MySQL BUG: Error 1221 (HY000): Incorrect usage of DB GRANT and GLOBAL privileges

Source: Internet
Author: User

MySQL BUG: Error1221 (HY000): Incorrect usage of DB GRANT and GLOBAL privileges
When performing a prelude to MySQL replication: This error occurs when you create a user for the primary server to connect from the server:
GRANT REPLICATION SLAVE on a_database.* to ' repl ' @ ' domain.test ' identified by ' slavepass ';
Specifying a database I want to be able to replicate only this database and ignore other (created or future-created) databases.
Because I don't know. MySQL can have a specific parameter to specify the database in the configuration file (/etc/my.cnf) (or specify this parameter at startup):--replicate-do-db= database name
Reference: Tells the copy of the statement that restricts the default database (selected by use) to db_name from the server. To specify multiple databases, use this option more than once per database.
From the MySQL5.1 manual 6.8 section, see here for more detailed instructions:
Http://dev.mysql.com/doc/refman/5.1/zh/replication.html#replication-options

Reference: http://forums.mysql.com/read.php?26,47781,47828#msg-47828

The subject of this question on the official forum: http://forums.mysql.com/read.php?26,47781,47781
There are also: http://forums.admon.org/databases/6970-error-1221-hy000-incorrect-usage-db-grant-global-privileges.html

Reason: is this permission (REPLICATION SLAVE) is a global privilege and cannot be assigned to the database level individually.
For example, file permissions cannot be granted to database level:
Reference: It complains about this you is trying to use the FILE privilege on a database level. And that's a Global privilege.
See:http://forums.devshed.com/mysql-help-4/ Error-1221-wrong-usage-of-db-grant-and-global-privileges-110852.html

Super Privileges also apply:
See:http://webcache.googleusercontent.com/search?q=cache:http://systemadmin.es/2011/10/ Incorrect-usage-of-db-grant-and-global-privileges

EOF. The last Link:
Http://www.osgeo.org/files/fdo/docs/FET_TheEssentialFDO/files/WS1a9193826455f5ff9110c71085341391d-2981.htm

This article is from the "Boyhack" blog, make sure to keep this source http://461205160.blog.51cto.com/274918/1748348

MySQL BUG: Error 1221 (HY000): Incorrect usage of DB GRANT and GLOBAL privileges

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.