Often you’ll need some remote access to your database in order to retrieve or manage data.
This can be set up quite easy.
First step would be to allow the network to access the mysql service. This is done by editing the /etc/my.cnf configuration file.
Now look for the line which contains # skip-networking and uncomment it.
Save the configuration file and restart the mysql service.
service mysqld restart
Now that you just allowed network access to your MySQL server you probably need to assign some credentials for remote access.
First login to your db:
mysql -u root -p mysql
Then you’re ready to create a database:
mysql> CREATE DATABASE database;
create a username for remote access:
mysql> GRANT ALL ON database.* TO user@’host’ IDENTIFIED BY ‘PASSWORD’;
or grant access to an already existing database:
mysql> update database set Host=’22.214.171.124′ where Db=’database’;
mysql> update user set Host=’126.96.36.199′ where user=’admin’;
Note: to grant access to any host use the wildcard ‘%’ instead of a host name/ host ip.