Mysql cannot log in with root

Discussion in 'General' started by HyperAtom, Jun 24, 2010.

  1. HyperAtom

    HyperAtom New Member

    Hi all, i followed the perfect server guide for ubuntu 10.04. All was working fine, I could log into the root account of mysql. I made a mistake by creating a database in the ispconfig 3 web interface owned by root, after deleting that table I can no longer access the root account.

    I get the error message: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
    I have also tried it without a password but still nothing.

    I have followed various guides on the internet in order to restore the root account, for example skipping grant tables, but to no success. The root user is actually still there in the mysql table but I can't seem to log in with it.

    Could anyone please help me?

    Regards, Adam.
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Thats why there is a database prefix in ispconfig by default which should never be removed.

    Your problem is that the root account has been reconfigured to be able to access only the database that you created in ispconfig. The solution is to restart mysql with skip grant tables, then login to phpmyadmin, delete the lines for the root user in the mysql.users and mysql.db table and create 2 new lines for the root user in the mysql.users table (one for localhost and one for 127.0.0.1) were you set all option (restrictions) to 'Y'.
     
  3. HyperAtom

    HyperAtom New Member

    Thanks for your fast responce, I will try that out later and let you know.
     
  4. HyperAtom

    HyperAtom New Member

    When adding the new root user I recieve this error message:


    Error

    MySQL said: Documentation
    #1582 - Incorrect parameter count in the call to native function 'UNHEX'
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    You have to add one user after another with saving the first user before you create the second one and not both users at the same time in phpmyadmin.
     
  6. HyperAtom

    HyperAtom New Member

    Ok I got around that error by changing the 3 'blob' type fields to UUID. Root user added to user table for localhost and 127.0.0.1, restarted mysql normally.

    /etc/init.d/mysql start
    mysql -u root -p - entered my pass but got:

    ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    And you selected "password" as function for the password column as you entered the new root users?
     
  8. HyperAtom

    HyperAtom New Member

    Thats it! Forgot to do that, went back and changed it to 'PASSWORD' and all is well. Thank you so much for your kind help!
     

Share This Page