Is it possible to notify a database from another database, both the database are on different server. and both the database are different type. eg. if i have a DB2 database on one server and some records are updated on this database than need to notify another DB and modify some table in on that DB(my case it is MYSql).
Thanks in advance
You can create a link between databases and using triggers - update corresponding data in the other database.
I would investigate replication, to see if mySQL can be a replication target for DB2.
Read introduction to SQL Replication.
Related
I have two different databases. I have to access data from one database and insert them into another ( with some data processing included, it is not only to copy data ) Also, the schema is really complex and each table has many rows, so copying data into schema in the second database is not an option. I have to do that using MySQL Workbench, so I have to do it using SQL queries. Is there a way to create a connection from one database to another and access its data?
While MySQL Workbench can be used to transfer data between servers (e.g. as part of a migration process) it is not useful when you have to process the data first. Instead you have 2 other options:
Use a dedicated tool you write yourself to do that (as eddwinpaz mentioned).
Use the capabilities of your server. That is, copy the data to the target server, into a temporary table (using dump and restore). Then use queries to modify the data as you need it. Finally copy it to the target table.
I have this project that would require users to check in/out through a finger print reader ZK SF200.
The system that I am building needs to fetch new data that is added into this machine's database which unfortunately is a MS Access mdb file.
In my limited experience in MS Access databases, I managed to link this file to my MySql database table which allows me to manually do the insert from MS Access.
All I want to do now is to create some form of trigger that would add data to my MySql database when new rows are inserted into the MS Access table.
This problem would have been solved if the file type was .accdb because we can use After Insert events however it is an mbd type so those are not supported.
Any idea on how I can solve this matter ?
As a final note: I am willing to change DBMS in case MySql is the obstacle here. Would creating a linked server or doing sql server replication through mssql 2008 r2 work ?
EDIT: I need to insert data to MySql table because I have a trigger implemented there which does its side of logical manipulation of the data (ex: Increment the number of visits for the customer, check if customer subscription has expired or not and update the customer status accordingly)
Thank you.
Linking a table in MS-Access to the ODBC source is probably an answer for you. The table in MS-Access will be more like a view on the source table. Any DML operation (INSERT, UPDATE, DELETE) will be synced immediately with the source database. You will not need any trigger, which is not available in MS-Access (unless some VBA expert knows a solution).
The Linked table technology is default available for SQL-server, but since it uses ODBC I quess you can use it with MySQL too.
Is there any way of making a database offline/down/inactive/secondary on MYSQL SERVER ...so that when we query like SHOW DATABASES it will give us the list of active/online/primary databases....?
Also making these databases down/secondary will affect the synching with other database servers?
Actually it's not a database, it's a schema (show databases). You can down the whole instance but not schema.
I want to write a php code to be embedded in drupal7 module.
I want to call a procedure which can copy the newly generated data in local mysql database to the remote mysql database.
When data is inserted in tables 'A' of my local data base it should be copied to the specific table 'B' of the remote mysql server's database.
Table 'A' is on local host.
Table 'B' is on remote server.
insert data on 'A' -> copied data in 'B'
Is this possible?
Thanks for the help.
Trigger + Federated tables should do the trick:
http://dev.mysql.com/doc/refman/5.0/en/federated-use.html
http://dev.mysql.com/doc/refman/5.0/en/federated-limitations.html
If you're looking for automatic backups or master->slave duplication, there are ways to accomplish that without touching a line of code.
See here for how:
http://dev.mysql.com/doc/refman/5.0/en/replication-howto.html
This is my personal favorite:
http://blog.evandavey.com/2008/05/how-to-setup-mysql-replication-a-simple-guide.html
Related post:
phpmyadmin synchronize
Still need help doing that? Post.
Is it possible to update a table in SQL Server using a trigger in MySQL. The scenario is like this.
When a table is updated in MySQL, a corresponding update is to be done in SQL Server for the purpose of syncing certain fields. I understand that the reverse is possible using a linked server in SQL Server.
You can write a UDF function that would update data in the SQL Server. Then call this UDF from the trigger.
Here's some information which may be of help regarding linking SQL Server and MySQL
http://forums.mysql.com/read.php?60,123221,123221
I'm afraid I've no personal experience in the matter as I thankfully have MySQL servers across the board, however had a scan through the links in the above and at least one of them should be able to assist.