Ionic+xampp on localhost


Hello fellow developers,

Before I delve into my problem, I need to tell you guys I’m totally new to mobile app development but have some meager experience in web frameworks and web development. (Please be nice :cry: )

I wanted to do the following:

  1. Run ionic framework’s live view on browser. As in, the one brought up by this command: ionic serve --lab
  2. Run a localhost mysql using xampp.
  3. Connect the ionic mobile app running within the live view to the localhost’s mysql.

I’ve been doing some reading and Googling. Nothing solid comes up. Can it be done? If yes, can someone share with me how or link to a tutorial. I am under the impression that there will be a port clash of sorts. I am only doing this for a final year project so it doesn’t need to be ported elsewhere but shown to be working in sandbox environment.

Thank you in advance :grinning:


Ionic app can’t directly connect a MySql database.
You must wrote an interface (rest, soap) and using it’s with ajax.


Thank you so much for replying. Alright, I’ll try the approach with that in mind. Can you give the outline of the steps I should take? I wil probably be using SQLite to store the data in the phone first, then connect to MySQL in an online db.


There are many project that offers restful api for MySql, some in php, other in nodejs. php nodejs



Have you tried it with XAMPP server using the interface (REST , SOAP).
Request you that if have implemented then please provide me the steps.

Thanks in Advance
Abinas Patra


Hello Abinas,

I did. But I was running out of time for the project so I used PouchDB/CouchDB to do the REST for me. Or you can try Firebase.