Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8864905
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T16:22:11+00:00 2026-06-14T16:22:11+00:00

How possible is it to get mysql database changes to be pushed to a

  • 0

How possible is it to get mysql database changes to be pushed to a an admin screen without admin interaction using pusher?

Can pusher run some kind of listener for changes on the mysql or will pusher simple do some kind of fancy polling?

All in all how would such a setup be coded?

A simple example or a link would be very much appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T16:22:12+00:00Added an answer on June 14, 2026 at 4:22 pm

    Invoke PubNub PUSH Message via MySQL Trigger on UPDATE, INSERT and DELETE

    ⚠️ Warring! this may cause slowdowns on your database. This will introduce relatively poor performance given sys exec’ing curl for every insert. Far better to also have a trigger write the message to another table and have another process checking for new rows in a loop.

    MySQL Makes it simple to wrap your coding into easily accessible TRIGGERS via Stored Procedures. You can create something similar with pusher and I know how to do it with PubNub; so here is a quick guide with PubNub and MySQL. Simplicity is what you seek and here is your solution! I will walk you through an easy way to bind any UPDATE, INSERT and DELETE action on your table to a stored function that will get invoked each time, sending a push notifications to your mobile and web apps easily with PubNub.

    PubNub Push Message

    DELIMITER $$
    CREATE PROCEDURE push_message
    (p1   DOUBLE,
     p2   DOUBLE,
     p3 BIGINT)
    BEGIN
     DECLARE cmd CHAR(255);
     DECLARE result CHAR(255);
     SET cmd = CONCAT('curl https://pubsub.pubnub.com/publish/demo/demo/0/mysql_triggers/0/%22',p1, ',' ,p2, ',' ,p3,'%22');
     SET result = sys_eval(cmd);
    END$$;
    

    NOTE: Make sure your PROCEDURE types are correct DOUBLE or VARCHAR or TEXT.

    MySQL Trigger Code INSERT Example

    CREATE TRIGGER push_message_trigger AFTER INSERT ON your_table_name_here
    FOR EACH ROW
    CALL push_message(NEW.Column1, NEW.Column2, NEW.Column3);
    

    NOTE: Make sure to include the columns you need here in your push message.

    MySQL Trigger Code UPDATE Example

    CREATE TRIGGER push_message_trigger AFTER UPDATE ON your_table_name_here
    FOR EACH ROW
    CALL push_message(NEW.Column1, NEW.Column2, NEW.Column3);
    

    Monitor the Push Message via Debug Console

    http://www.pubnub.com/console?sub=demo&pub=demo&channel=mysql_triggers – You can watch your triggers being fired via PubNub Dev Console. This way you can understand what paramaters you need to have changed and what data is important for you to include in each push notifications that can be received by PubNub websocket and more on the Mobile and Web device.

    Receiving The Push Message in JavaScript

    <div id=pubnub ssl=on></div>
    <script src=//pubnub.a.ssl.fastly.net/pubnub-3.4.5.min.js></script>
    <script>(function(){
    
        PUBNUB.init({
            subscribe_key : 'demo',
            ssl           : true
        }).subscribe({
            channel  : 'mysql_triggers',
            callback : function(mysql_trigger_details) {
                alert(mysql_trigger_details);
            }
        });
    
    })();</script>
    

    Now you have the steps needed to send and receive change events from MySQL directly via simple procedures. There are ways to optimize this method as well such as issuing a signal to a daemon process that queues and pools HTTPS push notifications. This should be plenty efficient.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to somehow get structure of MySQL database, or just some table
I'm looking for the simplest possible solution to get mysql database records as XML
Is there a way to get all possible values from a MySQL enum column?
Possible Duplicate: Get the resolution of a jpeg image using C# and the .NET
Possible Duplicate: Get the IP Address of local computer Obtaining local IP address using
I took over some old php application with MySQL as database. Inside the database,
I am using fulltext searching in mysql to search a database of videos I
Is it possible to get the height of a 'text' field from mysql? Or
When I started up my MySQL server today and try to do some changes
I am using winform, mysql, c# in my project. I want to get server

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.