Connect to mysql on Amazon EC2 from a remote server

Change /etc/mysql/my.cnf
Change /etc/mysql/my.cnf



And
It could be that you have not configured the Amazon Security Group assigned to your EC2 Instance to accept incoming requests on port 3306 (default port for MySQL).
If this is the case then you can easily open up the port for the security group in a few button clicks:
1) Log into you AWS Console and go to 'EC2'
2) On the left hand menu under 'Network & Security' go to 'Security Groups'
3) Check the Security Group in question
4) Click on 'Inbound tab'
5) Choose 'MYSQL' from drop down list and click 'Add Rule'
Might not be the reason but worth a go...


Once, you are logged in, you need to create a new MySQL user. First, issue the following command to login with the root user 

mysql -u root -p

  1. If a password is set provide the password and login. Now create a new user with this command
    create user 'bill'@'%' identified by 'some_password';
    Replace ‘bill’ with your username and ‘some_password’ with your desired password
  2.  Grant all privileges to the user ‘bill’
  3. Grant all privileges on *.* to 'bill'@'%' with grant option;
     
     

Comments

Popular Posts

How to pass hash in Postman

nginx: unrecognized service

Bootstrap Select Picker append add new item if search not exist

Reading Excel Sheets using "Roo" gem in ruby on rails

Add CORS to Nginx on AWS Elastic Beanstalk

Enable gzip compression on Elastic Beanstalk with nginx

Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'

Get video duration by URL in Ruby on Rails

site-enables nginx setting in ruby in rails