[Ilugc] MySQL - unable to connect to MySQL db from another host on same LAN

  • From: knura9@xxxxxxxxx (Arun Khan)
  • Date: Wed, 6 Aug 2014 16:37:56 +0530

SOLVED.

On Wed, Aug 6, 2014 at 1:04 PM, Arun Khan <knura9 at gmail.com> wrote:

On Wed, Aug 6, 2014 at 12:38 PM, Arun Venkataswamy <arun289 at gmail.com> 
wrote:

Is the mysql server listening on all interfaces?
I think by default it listens only on localhost or 127.0.0.1


Yes, bind_address=0.0.0.0  (allow connection from any IP number).

Another naive point, just to be sure : Have you opened up port 3306 in the
firewall?

AWS, has a pretty neat concept called "Security Groups"  wherein you
can define inbount and outbound traffic.

Checked that as well, inbound to 3306 is allowed.
 I can telnet aws-appsrv 3306 from a different node and get connection
and prompt for password.

One of my Member of Technical Staff found the solution.
Ref. URL <http://www.mysqltutorial.org/mysql-grant.aspx>

Specifically the following commands in a 'mysql -u root -p' session

CREATE USER '<username>'@'<hostname>' IDENTIFIED BY '<password>';
create database userdb;
GRANT ALL userdb.* TO '<username>'@'<hostname>' WITH GRANT OPTION;
flush privileges;

-- Arun Khan

Other related posts: