Hi - I am new to Wix and I'm trying to connect to an external mysql DB. I've seen people say that it was not possible in the past but I've read of people using NPM mysql. I'm wondering what is the best/easiest way to do this in late 2018.
I tried to get the sample code from here https://www.npmjs.com/package/mysql working on a backend web module but get the error 'require' is not defined.
Any advice is appreciated! Thanks
Hi tpolig01,
I'm starting to use Wix to create a site, and one of the functions we chose it is because it allows to connect with an external MySQL DB. We have one, but weren´t able to connect to it.
We connect to it locally and over Internet, via php, via vb.net and so on, but no way to do it via Wix.
We've tried to add the Database as a external collection, but doesn't work. Have open a ticket with Wix a few days ago, but still haven't got a response. It seems that adding npm mysql module is the first step, but don't know wich are the next ones.I've read all your posts, and it seems you were in a similar situation, and solved it, but I can't see how you do it.
So If you could gave me some basic instructions about how to call the BackEnd .jsw module from the Front End to get the MySQL data in my page, I'll be very gratefull. Thank you anyway for your posted code.
l
can you help me to get connected and write some data to mysql database. A sample code will be very helpful
Have you been able to solve require problem?
this has come up before. Search this forum on "require". Basically, if I remember correctly, require is flagged as an error in the editor (red dot), but will run in Publish Mode. If you want to avoid this, replace "require" with import. There are enough examples around in the Tics and Tricks section. Good luck.
And BTW: keep me updated on the progress. Very interested to know how far you get, what you needed to (re)develop (like data binding, if you use Wix Code Input elements).