Chinaunix首页 | 论坛 | 博客
  • 博客访问: 417317
  • 博文数量: 71
  • 博客积分: 1525
  • 博客等级: 上尉
  • 技术积分: 605
  • 用 户 组: 普通用户
  • 注册时间: 2011-08-05 17:28
文章分类

全部博文(71)

文章存档

2012年(21)

2011年(50)

分类: Mysql/postgreSQL

2012-01-27 12:04:08

【转】
服务器环境 Ubuntu 10.04
 
1. 停止mysqld;
/etc/init.d/mysql stop
 一定要保证停止mysqld的运行
2. 用以下命令启动MySQL,以不检查权限的方式启动;
mysqld --skip-grant-tables &
3. 然后用空密码方式使用root用户登录 MySQL;
mysql -u root
4. 修改root用户的密码;
 mysql> update mysql.user set password=PASSWORD('newpassword') where User='root'; 
mysql> flush privileges;
mysql> quit
重新启动MySQL
/etc/init.d/mysql restart
就可以使用新密码 newpassword 登录了。
阅读(1474) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~