|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
data from two datasources: got it with mysql
Author: Sebastian Mork
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:44524#231594
Hi,
great, its working now :)
(using mysql 5 with The FEDERATED Storage Engine) to access a local and a remote
database within one query. http://dev.mysql.com/doc/refman/5.0/en/federated-storage-engine.html
I've just installed
- MySql 5.0.18 on my xp-machine (+ the latest phpMyAdmin-version +
mysql-administrator)
- then my datasources didn't verfy using the built-in (mx7) odbc-driver MySql
(3.x)
- so I downloaded and installed the MySQL Connector J JDBC driver (3.1.7) from
ftp://mirror.services.wisc.edu/mirrors/mysql/Downloads/Connector-J/mysql-connector-java-3.1.7.zip
(notes from mm/adobe creating a datasource: http://www.macromedia.com/cfusion/knowledgebase/index.cfm?id=6ef0253
and thanks ben & comments: http://www.forta.com/blog/index.cfm?mode=entry&entry=A61BD155-3048-80A9-EF63F5397C4511AA)
- then I saw executing 'show engines;' in the mySql-console that the federated
engine was not supported.
- to get it running I stopped and uninstalled the running mysql-service (mysqld
--remove)
- and re-installed the service to support the federated engine with: mysqld-max
--install (thx to user-comment in the first url at the top)
- to test it I created a sql-dump of a database and imported it on a
linux-machine in my network running mySql 3.x and imported it local
on my xp-machine running mySql5.
- in my local database I deleted a table products and then created it new again
with a sql-command (and exact fields, keys .. like on the
remote machine) just at the end of the command added: ENGINE = FEDERATED
CONNECTION =
'mysql://user:pass@192.168.0.105:3306/databasename/products';
Now when I view the data of my products-table locally, mysql retrieves the data
from the remote-machine. great :-)
Two things I've to worry about is now: what if the remote db is down (argh, don't
know yet, how I'll handle, maybe just try/catch..) the
second is, when my app is ready to get released on production server, I'll need
mysql5, the connector and the federated storage engine
support)
anyway, I really like that..
--
Sebastian Mork
federente@gmx.de
--
On Tue, 7 Feb 2006 15:00:11 +0000
Michael Traher <michael.traher@gmail.com> wrote:
----- Excess quoted text cut - see Original Post for more -----
|
February 04, 2012
|
Latest Fusion Authority Articles
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||