Connecting aws ec2 mysql from workbench
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:
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’@’22.214.171.124’ IDENTIFIED BY ‘root1’;
GRANT ALL PRIVILEGES ON javadomain.* TO ‘root’@’126.96.36.199’;
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
# this allows all ip addresses, if you want to restrict only to particular ip then enter that address.
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.
47 total views, 1 views today