Connecting aws ec2 mysql from workbench

Hello all,

After a lot of struggle I finally made connection to aws ec2 mysql from workbench, posting here to help you guys.

Connecting aws ec2 mysql from workbench:

Connecting aws ec2 mysql from workbench

 

 

If you are getting any other exceptions then do validate the below steps once again,

 

Step 1: Creating root user with all the privileges:

CREATE USER ‘root’@’18.188.178.178’ IDENTIFIED BY ‘root1’;
GRANT ALL PRIVILEGES ON javadomain.* TO ‘root’@’18.188.178.178’;

javadomain => database schema (which I created directly in linux mysql login).

If you like to allow all databases then try ON . instead of javadomain.*

Please do restart your mysql

sudo service mysqld restart

 

can be used in aws ec2 instance for restart your mysql in aws.

Step 2: Add bind-address in my.cnf file

sudo vi my.cnf

and add

# this allows all ip addresses, if you want to restrict only to particular ip then enter that address.

bind-address=0.0.0.0

just before mysql_safe option and restart it.

 

 

Step 3: Ensure you added mysql port 3306 in your aws security groups

More tutorials available online, so skipping this step for detailed explanation.

 

 

Other useful commands related to this:

  • sudo service mysqld start
  • sudo service mysqld stop
  • sudo service mysqld status
  • Mysql installation path: /var/lib/mysql

 

Mysql installation in aws ec2 linux:

  • sudo yum update -y
  • sudo yum install -y httpd24 php70 mysql56-server php70-mysqlnd

Facing any issues, have a look at this post.

 

Leave a Reply