Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3319442
  • 博文数量: 258
  • 博客积分: 9440
  • 博客等级: 少将
  • 技术积分: 6998
  • 用 户 组: 普通用户
  • 注册时间: 2009-05-03 10:28
个人简介

-- linux爱好者,业余时间热衷于分析linux内核源码 -- 目前主要研究云计算和虚拟化相关的技术,主要包括libvirt/qemu,openstack,opennebula架构和源码分析。 -- 第五届云计算大会演讲嘉宾 微博:@Marshal-Liu

文章分类

全部博文(258)

文章存档

2016年(1)

2015年(4)

2014年(16)

2013年(22)

2012年(41)

2011年(59)

2010年(40)

2009年(75)

分类: Mysql/postgreSQL

2012-08-03 11:56:10

    今天在使用mysql的时候,碰到如下错误:

  1. Access denied for user 'root'@'localhost' (using password: YES)
google了下,这种问题还挺普遍了的,试了一种解决方法也OK,在此记录下,以备使用。

  1. # /etc/init.d/mysqld stop
  2. # mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
  3. # mysql -u root mysql
  4. mysql> UPDATE user SET Password=PASSWORD('newpassword') where USER='root' and host='root' or host='localhost';
  5. mysql> FLUSH PRIVILEGES;
  6. mysql> quit
  7. # /etc/init.d/mysql restart
  8. # mysql -uroot -p
  9. Enter password: <输入新设的密码newpassword>

阅读(2284) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~