Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

share|improve this question
    
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. –  Harbhag Jun 21 '12 at 7:23
add comment

1 Answer 1

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'@'%' ......; 
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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