mysql备份一直报错

回复 收藏
我运行了 /usr/bin/mysqldump  -uroot –phuningfei cacti > /tmp/cacti.sql
错误提示:
mysqldump: Got error: 1045: Access denied for user 'root'@'localhost' (using pas                                                                                            sword: NO) when trying to connect
我的root账户权限和密码都没问题,不知道是那里出错了?
2016-05-05 11:44 举报
已邀请:
0

maria

赞同来自:

{:6_137:}试试/usr/bin/mysqldump  -uroot –p cacti > /tmp/cacti.sql,回车然后输入密码
0

渐行渐远

赞同来自:

maria 发表于 2016-5-5 11:53
试试/usr/bin/mysqldump  -uroot –p cacti > /tmp/cacti.sql,回车然后输入密码

不行   ,还是这样

/
  1. usr/bin/mysqldump  -uroot –p cacti > /tmp/cacti.sql
  2. mysqldump: Got error: 1045: Access denied for user 'root'@'localhost' (using pas                                                                                            sword: NO) when trying to connect
0

malong

赞同来自:

你root的密码是cacti吗
0

maria

赞同来自:

渐行渐远 发表于 2016-5-5 11:57
不行   ,还是这样

/

那就检查一下你的root用户,是不是有密码,对这个cacti库是不是有权限,
0

渐行渐远

赞同来自:

malong 发表于 2016-5-5 12:01
你root的密码是cacti吗

不是cacti 是huningfei
0

乐橙306

赞同来自:

http://www.apelearn.com/bbs/thread-10561-1-1.html

1045:不能连接数据库,用户名或密码错误

mysql  -uroot  -p

mysql> GRANT ALL PRIVILEGES ON cacti.* TO 'hnf@'localhost' IDENTIFIED BY  'hnf@2014';

mysql> flush  privileges;

mysql>exit

截图

mysqldump   -uhnf -p  cacti >  /tmp/cacti.sql

截图


0

渐行渐远

赞同来自:

乐橙306 发表于 2016-5-5 13:17
http://www.apelearn.com/bbs/thread-10561-1-1.html

1045:不能连接数据库,用户名或密码错误

厉害,我执行了GRANT ALL PRIVILEGES ON cacti.* TO 'hnf@'localhost' IDENTIFIED BY  'hnf@2014';
这个之后备份居然不提示了,之前我也授权了,用的是grant all on *.* to 'root'@'localhost' identified by 'huningfei'; ,居然不行
0

乐橙306

赞同来自:

渐行渐远 发表于 2016-5-5 13:29
厉害,我执行了GRANT ALL PRIVILEGES ON cacti.* TO 'hnf@'localhost' IDENTIFIED BY  'hnf@2014';
这个 ...

解决了就好
0

栋佐

赞同来自:

重新设置一下root密码或者创建一个新的mysql账户试试。
0

追梦人

赞同来自:

应该是授权没有成功吧,可以看看日志排查一下!

回复帖子,请先登录注册

退出全屏模式 全屏模式 回复
评分
可选评分理由: