Setting different MySQL login details on live server

I’ve trawled through loads of posts and info but just can’t find the solution.

I’m working on a site locally (all fine) and am now uploading it to a live server to show the client. I’ve set up the new target and FTP has worked fine so all the files are now there. I’ve also created the MySQL database and copied all the data from my local (localhost using MAMP) machine.

I am now trying to change the connection details so it uses the database on the live server.

I’m editing the Connection Options. If I put in the IP address of the live server for the Server Address and all the other details I get this error:

Error using this Database Connection!
Server Response ; could not find driver

Other posts have said to use localhost instead but, obviously, that’s not going to find the live data.

I’ve also tried manually editing the connection script at /dmxConnect/modules/Connections on the live server but that just gives me a 500 Server Error in the browser console.

In the old days of Dreamweaver, I would upload everything to a live server, edit the connection script and just not upload that script again. I’m happy to work that way with Wappler but it just doesn’t seem to like it!

The live server is one of our dedicated servers running a very standard cPanel setup and I’ve added my local IP to the database so it allows a connection from my local machine but it’s still not having it.

Help!

Hi Jon,

Just a thought…if your live mysql server is on the same server as your live web server, then localhost will actually work. This is how my database connection is setup, and working well.

–Ken

Thanks Ken. The trouble is I would be entering ‘localhost’ into Wappler and so the username and password won’t match. And I can’t set the local credentials to be the same as the server ones.

Ya, I think we’re kinda stuck with this for now.

Maybe throw a vote on this?

1 Like

I’ve just voted for this.

Is there a manual fix in the meantime? I need to show the client the work in progress but I can’t get the live server to connect to the database.

JOn

I think this is a separate issue.

In have successfully done exactly what you describe on several occasions, normally just updating the mysql server connection settings will do what you want.

I am a bit surprised at the error you show as this may have come from the server rather than Wappler. Are you sure you have selected the correct database connection settings?
I assume, you are using PHP/ MySql?

Hi Brian

Thanks for that. So editing the connection script in /dmxConnect/modules/Connections should do the trick? I don’t even mind keeping a copy of it to replace it every time I upload to the live server (although not ideal long term).

The database connection details are definitely correct. I will try it again, though.

Hi again

Thanks everyone for your input. I’m finally up and running on a live server.

The driver error is fixed. Bizarrely, if I set the MySQL details when the target is set to my localhost, it works. If the target is set to my live server, I get the driver error.

The 500 Server Error I was getting turns out to be the PHP version. Slightly odd as I’m using 7.3 on my localhost but when using 7.3 on the live server, it doesn’t like it. So I’ve changed the live server to 7.2 and it’s now working.

So all is now good.

I would still LOVE to see data connection details stored in the target settings so we don’t have to have these issues.

1 Like

Great news, delighted it’s working.

1 Like