April 12, 2017

How to Allow MySQL Remote Access in Ubuntu Server 16.04 on AWS

Step1:  Enable MySQL Server Remote Connection in Ubuntu
By default MySQL Server on Ubuntu run on the local interface, This means remote access to the MySQL Server is not Allowed. To enable remote connections to the MySQL Server we need to change value of the bind-address in the MySQL Configuration File.
Search  mysqld.cnf file
$ mlocate mysqld.cnf
Output: /etc/mysql/mysql.conf.d/mysqld.cnf

Edit and modify mysqld.cnf  file to change bind-address   from 127.0.0.1 to  0.0.0.0

sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf
bind-address            = 0.0.0.0



Step 2. Modify PRIVILEGES
mysql> GRANT ALL ON *.* TO 'root'@'localhost';
Query OK, 0 rows affected (0.00 sec)
mysql> GRANT ALL ON *.* TO 'root'@'%';
Query OK, 0 rows affected (0.00 sec)
mysql> FLUSH PRIVILEGES; 


Query OK, 0 rows affected (0.00 sec)


Step 3. Allow remote computer to allow port 3306 



Step 4. Restart Server

$ sudo /etc/init.d/mysql  restart

3 comments:

john stany said...

You have provided an nice article, Thank you very much for this one. And i hope this will be useful for many people.. and i am waiting for your next post keep on updating these kinds of knowledgeable things...

Android App Development Company
iOS App Development Company

john stany said...

You have provided an nice article, Thank you very much for this one. And i hope this will be useful for many people.. and i am waiting for your next post keep on updating these kinds of knowledgeable things...

Android App Development Company
iOS App Development Company

Sharon Sandy said...

great and nice blog thanks sharing..I just want to say that all the information you have given here is awesome...Thank you very much for this one.
web design Company
web development Company
web design Company in chennai
web development Company in chennai
web design Company in India
web development Company in India