MySQL Forums
Forum List  »  MySQL Workbench

Re: Cannot connect from localhost, but can connect from other machine
Posted by: Teemu Ikonen
Date: June 19, 2012 08:43PM

We've same problem in 5.5.24-0ubuntu0.12.04.1 running in Amazon EC2. I can create users, grant privileges and connect from other machines but not at localhost. It does not matter if I specify '%' as host or what options I grant, it just doesnt work.

Curiously I can still connect as root from local machine.

ubuntu@db:/database$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.

But it doesn't work for for any other account. However, if I run command at localhost and specify the remote interface that MySQL is also listening it works.

mysql> show grants for wp;
GRANT USAGE ON *.* TO 'wp'@'%' IDENTIFIED BY PASSWORD '<hash>'
GRANT ALL PRIVILEGES ON `wordpress`.* TO 'wp'@'%'

Does not work

ubuntu@db:/database$ mysql -u wp -p'password' wordpress
ERROR 1045 (28000): Access denied for user 'wp'@'localhost' (using password: YES)

Works!

ubuntu@db:/database$ mysql -u wp -p'password' wordpress -h 10.249.9.141
Welcome to the MySQL monitor. Commands end with ; or \g.

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.