Chinaunix首页 | 论坛 | 博客
  • 博客访问: 246961
  • 博文数量: 61
  • 博客积分: 2510
  • 博客等级: 少校
  • 技术积分: 800
  • 用 户 组: 普通用户
  • 注册时间: 2008-02-14 15:18
文章分类

全部博文(61)

文章存档

2011年(4)

2010年(5)

2009年(10)

2008年(42)

我的朋友

分类: Mysql/postgreSQL

2008-03-05 10:09:41

Alternatively, on any platform, you can set the new password using the mysql client(but this approach is less secure):

  1. Stop mysqld and restart it with the --skip-grant-tables --user=root options (Windows users omit the --user=root portion).

  2. Connect to the mysqld server with this command:

    shell> mysql -u root
    
  3. Issue the following statements in the mysql client:

    mysql> UPDATE mysql.user SET Password=PASSWORD('newpwd')
        ->                   WHERE User='root';
    mysql> FLUSH PRIVILEGES;
    

    Replace “newpwd” with the actual root password that you want to use.

  4. You should be able to connect using the new password.

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