Page 1 of 1

mysql Access denied

Posted: Thu Nov 11, 2021 8:58 am
by idnoia
I use this tutorial lessons. livecod e. com/m/4071/l/7003-connecting-to-a-mysql-database
always doesn't work. I use cpanel shared hosting. does livecode no longer support mysql?

Re: mysql Access denied

Posted: Thu Nov 11, 2021 9:28 am
by matthiasr
Livecode still supports MySQL.

There could be several reasons why you cannot connect to your MySQL/MariaSQL database on a cPanel shared hosting.

1. cPanel blocks your IP, because it is not allowed to remotely access the DB
cPanel allows/allowed to setup remote ip addresses / hostnames which then were allowed to access the MySQL/MariaSQL database remotely. You can find this in cPanel under Databases -> Remote MySQL®. In some cases you had/have also to inform your provider that you've added something in that section, so the provider could make some additional adjustments to the firewall.

2. even if you've setup Remote MySQL® correctly, it might be that cPanel is not allowing remote access anymore due to some security updates. That's why i wrote also "allowed to setup". Many hosting providers still show that Remote MySQL® icon in cPanel, although it is not working anymore, for example LivcodeHosting or HostM.

Btw, HostM provides a nice tutorial including Livecode source how to access the DB remotely from your desktop app using some livecode server script.
https://www.hostm.com/tutorials/mariadb/remote-access
This way your desktop app communicates with the Livecode Server script on your webserver and the Livecode Server script does the complete DB stuff.

In case you still need to directly connect from your desktop app to your DB you could use a SSL tunnel.
https://linuxize.com/post/mysql-ssh-tunnel/
To get that working you'll need SSH access to your hosting account. HostM and LivecodeHosting will enable this for you, if you ask for it.

HTH
Matthias

Re: mysql Access denied

Posted: Thu Nov 11, 2021 9:51 am
by AndyP
Most shared hosting solutions do not allow remote access to databases, they expect that the ip of the request will be the same as the ip of the hosted db.

Saying that, if you are always going to connect via the same external ip then you can add that ip to the the remote access for the db.

cPanel > Databases > Remote MySQL .. but please read below:

For security reasons you should not connect directly from LiveCode or any other app for that matter to a hosted MySQL database. You should connect via a script on your hosting acting as a middleman.

Here is a link to a complete livecode solution which will help you to do this.

https://www.hostm.com/tutorials/livecod ... iadb-mysql

Let us know how you get on :)

Re: mysql Access denied

Posted: Sat Nov 13, 2021 10:55 am
by idnoia
yes my hosting provider doesn't allow doing remote mysql. so i will run into this problem :roll: