I'll preface by saying I think this is A Bad Idea. Be sure you read through the
MySQL reference manual section on
Server Administration and that you understand the risks involved prior to doing so!!
Also, look into using SSH for the MySQL connection. At the very least use the '-C' option when connecting from a remote address.
1) Make sure your iptables / firewall is allowing external access to TCP port 3306
2) Make sure your my.cnf [mysqld] section is using TCP (port 3306) instead of / along side a socket file.
3) Make sure your my.cnf is using bind-address to your external address
4) Create a user for an external connection, e.g.
Code:
CREATE USER external@'%' IDENTIFIED BY 'somepassword';
You can also specify a specific domain or IP addr you're connecting
from, e.g.
Code:
CREATE USER external@'otherdomain.com' IDENTIFIED BY 'somepassword';
5) Make sure you choke down the GRANT for this user!!
Code:
GRANT SELECT,INSERT,DELETE ON yourdb.* TO external@'%';
I think that's about it. Restart mysqld (/etc/init.d/mysql restart).