On my computer yesterday I installed 12.04 and applied all updates. I have installed lamp on this system using following command sudo apt-get install lamp-server^ phpmyadmin . I created a new user from phpmyadmin and given that user all the global privileges, but I am not able to login using that new user, I have also restarted the mysql service, reload the privileges, but still its not working. It used to work fine in Ubuntu 10.04.

  • try in terminal: mysql -u username -p [hit enter and give appropriate password]. Let use know the error message. – shantanu Jun 20 '12 at 3:34
  • The problem is that during the creation of user, I selected anyhost. But then I deleted the user and selected localhost and now its working. – hsinxh Jun 21 '12 at 7:23

Mysql is a bit odd in the fact that you if you want to login from that server only it is 'username'@'localhost' but if you need to login in from another server also you have to add a second user entry 'username'@'ipaddress' or 'username'@'%' for any host (apart from local host) and then grant privileges user each variation.

grant all on mydb.* to 'username'@'localhost'......... ; grant all on mydb.* to 'username'@'%' ......; 

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.