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)

CREATE USER 'root'@'%' IDENTIFIED BY 'yourpassword';
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

-->

No comments:

Creating DataFrames from CSV in Apache Spark

 from pyspark.sql import SparkSession spark = SparkSession.builder.appName("CSV Example").getOrCreate() sc = spark.sparkContext Sp...