Root permission error during MySQL GRANT Command Execution

Source: Internet
Author: User


A root permission error occurs when the MySQL GRANT command is executed. When the MySQL node executes the GRANT command to authorize the SPIDER server, the following error occurs:
Reference mysql> grant all on *. * TO 'spider '@ 'spiderdb' identified by 'spider'; ERROR 1045 (28000): Access denied for user 'root' @ 'localhost' (using password: YES) www.2cto.com, But I log on as a root user. The root password is empty. How can this error be reported. If the same error occurs on the Internet, it is a solution to logon without MySQL. If you forget the password, you can use the following method: Reference #/etc/init. d/mysql stop # mysqld_safe-u mysql -- skip-grant-tables -- skip-networking & # mysql-u mysql> UPDATE user SET Password = PASSWORD ('newpassword ') where USER = 'root'; mysql> flush privileges; mysql> exit www.2cto.com #/etc/init. d/mysqld restart # mysql-uroot-pnewpassword www.2cto.com, but this method cannot solve my problem. There is another way to delete the user online. if the value of user is NULL (delete from user where user is NULL), or update NULL to test (update user set user = 'test' where user is NULL ). But it is not easy to use. Occasionally, it is no problem to authorize a single database. Is it because root does not have the permission for a specific database? A script is written to execute "grant all on $ database. * TO 'root' @ 'localhost' identified by 'cps-pt' with grant option; ", an error occurred when information_schema was used. When Comrade dump/restore was executed two days ago, DB had been killed, and information_schema was damaged. This seems to be a bug in MySQL restore. Author: Qin Chao Gu Yue

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.