Solved

MYSQL V5 and higher Trigger

Posted on 2011-02-14
1
251 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

As a database administrator, you may need to audit your table(s) to determine whether the data types are optimal for your real-world data needs.  This Article is intended to be a resource for such a task. Preface The other day, I was involved …
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

630 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