MySQL: Remote Access

Tasks:
Open port 3306 for TCP

sudo /sbin/iptables -A INPUT -i eth0 -p tcp --destination-port 3306 -j ACCEPT
sudo /sbin/iptables-save

create user for remote access and grant all the privileges

create user 'root'@'%' IDENTIFIED BY 'pswd';
GRANT ALL PRIVILEGES on "." TO 'root'@'%' WITH GRANT OPTION;
flush PRIVILEDGES;

bind IP address to mysql

vim /etc/mysql/my.cnf
-bind-address = 127.0.0.1
+bind-address = 10.149.2.116


restart mysql

sudo service mysql restart
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s