Solved

MYSQL V5 and higher Trigger

Posted on 2011-02-14
1
247 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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
MySQL 11 80
SQL, Updating Statistics take too long for 60GB database 5 104
MSSQL 2008 with mySQL webservers 7 43
Sql query on a varchar that is numeric. 8 27
All XML, All the Time; More Fun MySQL Tidbits – Dynamically Generate XML via Stored Procedure in MySQL Extensible Markup Language (XML) and database systems, a marriage we are seeing more and more of.  So the topics of parsing and manipulating XM…
I have been using r1soft Continuous Data Protection (http://www.r1soft.com/linux-cdp/) for many years now with the mySQL Addon and wanted to share a trick I have used several times. For those of us that don't have the luxury of using all transact…
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…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

920 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

16 Experts available now in Live!

Get 1:1 Help Now