提示用户名错误,但密码正确,把manhzi改成root试试。还不行,再把mysql删除,重新安装覆盖,还不行把注册表里所有有关MYSQL的都删掉来试试咯。

解决方案 »

  1.   

    mysql -h localhost -u manhzi
    试试呢
      

  2.   

    GRANT ALL ON *.* TO manhzi@localhost IDENTIFIED BY "password"
      

  3.   


    執行mysql -h localhost -u manhzi
    可以訪問,而mysql -h localhost -u manhzi過-p
    password:輸入正确密碼後報錯:
    error:1045 Access denied for user:'[email protected]',<Using password :yes>
    執行GRANT ALL ON *.* TO manhzi@localhost IDENTIFIED BY "正确的password";
    卻報錯如下:
    error:1045 Access denied for user:'@127.0.0.1',<Using password :no>
      

  4.   

    呵呵,
    这怎么说呢,1)如果不慎忘记了MySQL的root密码,
    可以在启动MySQL服务器时加上参数--skip-grant-tables来跳过授权表的验证 (./safe_mysqld --skip-grant-tables &),
    这样就可以直接登陆MySQL服务器,
    然后再修改root用户的口令,
    重启MySQL就可以用新口令登陆了。
      

  5.   

    我學mysql時間數屈指可數,也就幾天而言.
    在mysql文档中從上到下找呀找,千辛万苦挖到这些话,對不起,有點亂:
    If you get an error like the followingshell> mysqladmin -u root -pxxxx ver
    Access denied for user: 'root@localhost' (Using password: YES)
    It means that you are using a wrong password
    If you have forgot the root password, you can restart mysqld with --skip-grant-tables to change the password(我忘記了?不會吧,老大,才設置幾天時間呀,清清楚楚記得.算了,先姑且當它錯嘍) See section A.4.2 How to Reset a Forgotten Root Password.(我按照它的步驟做了啊,還是不行,步驟如下:
    you can set the new password using the mysql client: 1.Take down and restart mysqld with the --skip-grant-tables option as described above.Connect to the mysqld server with 
    我執行sell>mysqld -skip-grant-tabales 
    後,dos窗口不可再輸入文字,只好關了窗口,重新進入,不知對不對): 
    2.shell> mysql -u manhzi mysql3.Issue the following commands in the mysql client: mysql> UPDATE user SET Password=PASSWORD('我的新密碼')
        ->             WHERE User='manhzi';
    mysql> FLUSH PRIVILEGES;After this, you should be able to connect using the new password.
    You can now stop mysqld and restart it normally.If you get the above error even if you haven't specified a password, this means that you a wrong password in some my.ini file.(這個我倒未有出現, 我省了密碼,可以進入) See section 4.1.2 `my.cnf' Option Files. 
      

  6.   

    是了,補充下還有這個方法,我第一步驟就不會了:)
    Take down the mysqld server by sending a kill (not kill -9) to the mysqld server. The pid is stored in a `.pid' file, which is normally in the MySQL database directory: 
    shell> kill `cat /mysql-data-directory/hostname.pid`
    (這條命令具體應如何輸入的呢, 我在安裝目錄找不相應的這個pid文件)You must be either the Unix root user or the same user mysqld runs as to do this. 
    Restart mysqld with the --skip-grant-tables option. 
    Set a new password with the mysqladmin password command: 
    shell> mysqladmin -u root password 'mynewpassword'Now you can either stop mysqld and restart it normally, or just load the privilege tables with: 
    shell> mysqladmin -h hostname flush-privilegesAfter this, you should be able to connect using the new password. 
    Alternatively, you can set the new password using the mysql client