Solved

MYSQL V5 and higher Trigger

Posted on 2011-02-14
1
248 Views
Last Modified: 2012-05-11
Cannot find allot of info on this matter so i would appreciate  some input.

I have stock that is changed on 1 server and stock that is changed on a other. To make sure both stock levels are the same i want to insert a trigger on both servers that update the central database.

So here is a example to clarify.

SERVER 1 datebase 1 = the wepshop
SERVER 2 datebase 2 = local administration
SERVER 2 datebase 3 = central stock

If any stock from db 1 has changed i want to get the stock from db 3 and deduct or add the stock from 3 and insert the new stock into all 3 databases.
edit: also need from db 2 to db 3
Is this even possible using mysql in phpadmin?]

also note that Server 1 and 2 are at different locations with different login.









 
0
Comment
Question by:ScottNL1
1 Comment
 
LVL 25

Accepted Solution

by:
Tomas Helgi Johannsson earned 500 total points
ID: 34895265
           Hi!

What about using the Fedarated storage engine ?
Using federated table in db1 and db2 where the physical table is in db3 would solve your problem
and you would have one stock table but it would be accessible in all 3 databases.
Also that would simplify the maintainance of the stock table.

http://dev.mysql.com/doc/refman/5.1/en/federated-storage-engine.html
http://dev.mysql.com/doc/refman/5.1/en/federated-create.html

Hope this helps.

Regards,
     Tomas Helgi


0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This guide whil teach how to setup live replication (database mirroring) on 2 servers for backup or other purposes. In our example situation we have this network schema (see atachment). We need to replicate EVERY executed SQL query on server 1 to…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now