你用root登录后,可以用如下语句进行修改:
mysql>use mysql;
mysql>update user set password=password("123456") where host="localhost" and user="root";如果要对别人进行授权就要用grant语句
我举个例子给你参考一下:
mysql>grant select,delete,insert,update,create,drop,index on inventory.* to david@localhost with grant option;上例中 on前面的都是privileges, 即是他可以进行的操作;
  后面的inventory是数据库名,inventory.*表示数据库里的所有表
  to参数后david是用户名,localhost是主机,可以用IP地址,后面还可以有一个identified by选项
  用来添加密码.
  identified by "123456"

解决方案 »

  1.   

    to: hy2003fly()我知道你的应该可以,可是当我在mysql > 后输入你写和那个修改用户密码的语名时,它说我没有选择任何数据库 ,当我输入use mysql;按回车时它提示我如下信息:
    ERROR 1044: Access denied for user: '@localhost' to database 'mysql'我查了一下当前sever信息是:
    Connection id:          8
    Current database:
    Current user:           ODBC@localhost
    SSL:                    Not in use
    Server version:         4.0.20a-nt
    Protocol version:       10
    Connection:             localhost via TCP/IP
    Client characterset:    latin1
    Server characterset:    gbk
    TCP port:               3306
    Uptime:                 20 min 40 sec可是我不知道如何来改变用户啊
      

  2.   

    你的用户名错了,ODBC不是mysql的默认用户名,
    你在dos的命令提示符下用以下方式进入mysql就可以了:
    C:\Documents and Settings\Administrator>mysql -uroot -p
    Enter password: ********
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 23 to server version: 4.1.12-ntType 'help;' or '\h' for help. Type '\c' to clear the buffer.说明:因为mysql的bin目录已经写到环境变量中去了,所以可以这样登录。
    又因为你的是空密码,所以你可以用mysql -uroot 就可以了,
    如果你看到
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 23 to server version: 4.1.12-ntType 'help;' or '\h' for help. Type '\c' to clear the buffer.
    就说明你已经正常登录,然后你再用我上面所说方法试试。
      

  3.   

    谢谢楼上的,我还是没有搞定,我把密码按照你的方法改成了00可是你看一下,我的登录过程:Microsoft Windows 2000 [Version 5.00.2195]
    (C) 版权所有 1985-2000 Microsoft Corp.C:\Documents and Settings\Administrator>mysql -uroot -p
    Enter password: **
    ERROR 1045: Access denied for user: 'root@localhost' (Using password: YES)C:\Documents and Settings\Administrator>mysql -uroot -p
    Enter password: ****************
    ERROR 1045: Access denied for user: 'root@localhost' (Using password: YES)C:\Documents and Settings\Administrator>mysql -uroot -p
    Enter password:
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 28 to server version: 4.0.20a-ntType 'help;' or '\h' for help. Type '\c' to clear the buffer.mysql>第一次:我用00登录不行,第二次:我用的是我从mysql管理软件中直接复制修改后的password字段中的内容;第三次:我用的是空密码,真是晕了,明明改了为什么不行呢?我早上的时候直接在管理软件里改成00保存后,也是不行,还是空密码,请问楼上的是什么原因啊?实在不好意思,我一问再问^_^!
      

  4.   

    你修改之后有没有重启mysql的服务呀?有的话仍然出现这种情况我就真的不知道是什么回事了。
      

  5.   

    恩,谢谢您哪,我没有重启公司里的mysql服务,我明天再试,真的不好意思再麻烦你了,我现在结贴了。