How to access a remote stored procedure from local database?

Posted on 2014-07-16
Last Modified: 2014-07-19
Dear Experts,

I came across an issue pertaining to stored procedure in mysql database. I have two offices which both of them are running on mysql. I've created a store procedure named 'UPD_INVENTORY' on mysql server#1. Currently, I am working at an office that has mysql server#2. If I wish to use the 'UPD_INVENTORY' stored procedure on mysql server#1, is there a way that I can make a stored procedure call on mysql server#1 from mysql server#2? Does such syntax exists like this:
CALL server#1location.db_name.procedure_name ? If not what other options do I have besides using php? Will I able to use bash script in linux to accomplish such a task?

Question by:Kinderly Wade
    LVL 53

    Expert Comment

    You should be able to use FEDERATED tables; though I have never tried to use a stored procedure that way.  Once you have a connect with federated tables you should be able to access just as if the table is local. However you may find you pay a big performance penalty.

    The manual description for federated tables is here:


    Author Comment

    by:Kinderly Wade
    Thanks COBOL for the feedback.

    I've tried with FEDERATED tables.

    Is it possible that I can make a call to a store procedure that's located on a remote mysql DB?
    If possible, how can this be achieved?
    LVL 53

    Accepted Solution

    Well if it won't let you run the stored procedure with a remote connection, then you will need to have a script on server #1 to run the stored procedure and return the data. Though I would have thought that the remote connection should be enough unless there is a security or permissions issue.


    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    Introduction In this installment of my SQL tidbits, I will be looking at parsing Extensible Markup Language (XML) directly passed as string parameters to MySQL 5.1.5 or higher. These would be instances where LOAD_FILE (…
    Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    733 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

    17 Experts available now in Live!

    Get 1:1 Help Now