26

How to connect MySql database with Firebase. This is for real time data updates and show it on browser. Already created Firebase account and got config code. Now I want connect my existing MySql based database with Firebase.

Please Help

Thanks

2
  • 1
    what will you after connecting ? Commented Jun 8, 2016 at 7:53
  • Basically I developed php web application and using MySql database. In some of the pages I need to show some realtime data. So. I'm trying firebase to achieve this. Commented Jun 8, 2016 at 8:11

2 Answers 2

12

This is something that I have been interested in recently as well.

Here is a great article that should answer your question:

https://firebase.googleblog.com/2013/03/where-does-firebase-fit-in-your-app.html

"Pattern 2: Firebase-powered app with server code" can probably provide you with a solution to connect Firebase to your MySQL DB.

What you could do is have your PHP app send updates to your firebase db when ever something update-worthy happens in your MySQL database. If all your clients are then subscribing/watching the changes to your Firebase db, then you have (albeit indirectly) connected your MySQL database with your Firebase db.

Hope this helps.

Sign up to request clarification or add additional context in comments.

2 Comments

you have a cron job to watch firebase db? or use firebase messaging?
@Thufir Hey Thufir, your php server code would subscribe to the firebase db similarly to how other clients do. In that way, your php server would be notified of firebase updates just like it would if it were a browser client.
2

You can store and retrieve Firebase data using REST API. Create the API in the same server as the Mysql database - this will work from any environment that lets you make HTTPS requests.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.