mysql Access denied

Creating desktop or client-server database solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
idnoia
Posts: 5
Joined: Fri Aug 13, 2021 7:45 pm

mysql Access denied

Post by idnoia » Thu Nov 11, 2021 8:58 am

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?
Attachments
Screen Shot 2021-11-11 at 14.51.30 2021-11-11 14-52-25.png

matthiasr
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 190
Joined: Sat Apr 08, 2006 7:55 am
Location: Lübbecke, Germany
Contact:

Re: mysql Access denied

Post by matthiasr » Thu Nov 11, 2021 9:28 am

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

AndyP
Posts: 615
Joined: Wed Aug 27, 2008 12:57 pm
Location: Seeheim, Germany (ex UK)
Contact:

Re: mysql Access denied

Post by AndyP » Thu Nov 11, 2021 9:51 am

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 :)
Andy Piddock
https://livecode1001.blogspot.com Built with LiveCode
https://github.com/AndyPiddock/TinyIDE Mini IDE alternative
https://github.com/AndyPiddock/Seth Editor color theming
http://livecodeshare.runrev.com/stack/897/ LiveCode-Multi-Search

idnoia
Posts: 5
Joined: Fri Aug 13, 2021 7:45 pm

Re: mysql Access denied

Post by idnoia » Sat Nov 13, 2021 10:55 am

yes my hosting provider doesn't allow doing remote mysql. so i will run into this problem :roll:

Post Reply

Return to “Databases”