Possible Duplicate:
can I access a remote mysql server/db from a stored procedure?
Is it possible to access another mysql server from stored procedure?
Possible Duplicate:
can I access a remote mysql server/db from a stored procedure?
Is it possible to access another mysql server from stored procedure?
In MySQL access tables from different servers from a single connection is federated tables: http://dev.mysql.com/doc/refman/5.0/en/federated-use.html Once you do that, it like access to a local table.
You can try to create a UDF which is user-defined function. You only should create and install this function into MySQL. It may be a little bit difficult, but you could try it.
And a simple way to access tables is to use federated engine (as Rena Sun suggested), was answered here - MySQL — Joins Between Databases On Different Servers Using Python?.