Chinaunix首页 | 论坛 | 博客
  • 博客访问: 591822
  • 博文数量: 118
  • 博客积分: 2114
  • 博客等级: 大尉
  • 技术积分: 1275
  • 用 户 组: 普通用户
  • 注册时间: 2009-03-10 00:02
文章分类

全部博文(118)

文章存档

2019年(1)

2018年(4)

2017年(1)

2016年(6)

2015年(1)

2014年(1)

2013年(5)

2012年(4)

2011年(17)

2010年(13)

2009年(65)

分类: Mysql/postgreSQL

2009-07-23 15:31:58

First things. Log in as root and stop the mysql daemon. Now lets start up the mysql daemon and skip the grant tables which store the passwords.

1. killall mysqld

2. /usr/bin/mysqld_safe --skip-grant-tables       #(if  the mysql installed by rpm, )

You should see mysqld start up successfully. If not, well you have bigger issues. Now you should be able to connect to mysql without a password.

3.#mysql --user=root mysql

mysql>update user set Password=PASSWORD('aaa123') where user='root';
msyql>flush privileges;
msyql>exit;

Now kill your running mysqld, then restart it normally. You should be good to go. Try not to forget your password again.

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