Wednesday, July 19, 2006

修改MySQL用户密码


  1. #在控制台上输入
    bash$ mysql -u root mysql
    #用mysql客户程序
    mysql> UPDATE user SET password=PASSWORD("new password") WHERE user='hunte';
    mysql> FLUSH PRIVILEGES;
    mysql> QUIT


  2. #在控制台上输入
    bash$ mysql -u root mysql
    mysql> SET PASSWORD FOR hunte=PASSWORD('new password');
    mysql> QUIT


  3. #直接在控制台上输入
    bash$ mysqladmin -u root "old password" "new password"

No comments:

Post a Comment