Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个脚本,我通过 perl 脚本进行备份,这会引发如下所述的错误
mysqldump:出现错误:1045:尝试连接时用户'root'@'localhost'的访问被拒绝(使用密码:YES)
我有 root 用户,其中 localhost 被提到为 %,根据文档,所有主机都是允许的。
有趣的一点是 mysqldump 命令在脚本之外运行良好,即在 shell 提示符下
有任何想法吗 ????
运行此命令以检查是否root具有从 localhost 连接的权限
root
SELECT user,host FROM mysql.user WHERE user = 'root'
如果列中没有带有的条目localhost,则不允许从 连接。您应该通过发出.hostrootlocalhostrootlocolhostGRANT
localhost
host
locolhost
GRANT