I am aware of this command:
GRANT ALL PRIVILEGES
ON database.*
TO \'user\'@\'yourremotehost\'
IDENTIFIED BY \'newpassword\';
But then it on
Assuming that the above step is completed and MySql port 3306 is free to be accessed remotely; Don't forget to bind the public ip address in the mysql config file.
For example on my ubuntu server:
#nano /etc/mysql/my.cnf
In the file, search for the [mysqld] section block and add the new bind address, in this example it is 192.168.0.116. It would look something like this
......
.....
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address = 127.0.0.1
bind-address = 192.168.0.116
.....
......
you can remove th localhost(127.0.0.1) binding if you choose, but then you have to specifically give an IP address to access the server on the local machine.
Then the last step is to restart the MySql server (on ubuntu)
stop mysql
start mysql
or #/etc/init.d/mysql restart
for other systems
Now the MySQL database can be accessed remotely by:
mysql -u username -h 192.168.0.116 -p