Direct access to MySQL on mobile

Klaus major-k klaus at major-k.de
Wed Jul 2 14:03:53 EDT 2025


Hi Matthias,

> Am 02.07.2025 um 19:46 schrieb Matthias Rebbe via use-livecode <use-livecode at lists.runrev.com>:
> 
> I would say that first depends on if the app is for ones own use or available to the public. 
> And 2nd for inhouse solutions direct access should not be a problem.
> But if the mySQL server is hosted on the internet even if the app is for ones own use, direct remote access wouldn‘t be a good idea. That‘s the reaons why most Web Hosters disable remote access to the MySQL server by default.
> 
> Before someone tries to invent the wheel a 2nd time. ;) 
> HostM offers a 100% Livecode Server api for free. More information and the download can be found here
> https://www.hostm.com/tutorials/livecode/api-mariadb-mysql

yes, sure!

But my student had already scripted the complete MySQL access before he contatcted me for montoring him.

Good news, there is already a webpage that does all this MySQL stuff neccessary for the mobile app, so I think 
I should convince him to do the "switch" to this already present middleware before he is going to publish the app 
for iOS and Android to the App stores.

But all this does not explain why we can access the db via LC on desktop in the IDE but get the mentioned error
when testing on a mobile device!? 

We will try the proposed solutions and will keep you informed!

> Regards,
> Matthias
> Von meinem iPad gesendet
> 
>> Am 02.07.2025 um 18:11 schrieb panagiotis merakos via use-livecode <use-livecode at lists.runrev.com>:
>> 
>> Hello all,
>> 
>> Off-topic (or maybe not) - it is not suggested to access the MySQL database
>> directly from the client app, either it is a Desktop app or a mobile one.
>> Accessing the DB directly means the credentials are stored in the app, so
>> theoretically a malicious actor could extract those from the app.
>> 
>> The recommended approach is to have the client app talk with the DB via a
>> LC Server .lc script, which will handle all the confidential info. So the
>> credentials will never leave the server. The flow is the following:
>> 
>> The client app talks to the server -> the server connects to the DB and
>> does the SQL query -> the DB returns the result to the server -> the server
>> returns the result back to the app.
>> 
>> Hope this helps.
>> 
>> Kind regards,
>> Panos
>> --
>> 
>>> On Wed, 2 Jul 2025 at 18:19, Klaus major-k via use-livecode <
>>> use-livecode at lists.runrev.com> wrote:
>>> 
>>> Hi Bob,
>>> 
>>>> Am 02.07.2025 um 17:13 schrieb Bob Sneidar via use-livecode <
>>> use-livecode at lists.runrev.com>:
>>>> Yes, but the wifi could be routed, in which case there can still be a
>>> firewall issue.
>>> 
>>> I'll let him check this, thank you.
>>> 
>>>> Bob S
>>>> 
>>>>> On Jul 2, 2025, at 8:10 AM, Klaus major-k via use-livecode <
>>> use-livecode at lists.runrev.com> wrote:
>>>>> 
>>>>> Hi Bob,
>>>>> 
>>>>>> Am 02.07.2025 um 17:04 schrieb Bob Sneidar via use-livecode <
>>> use-livecode at lists.runrev.com>:
>>>>>> I doubt that the issue is encryption. The error is that the host is
>>> unknown. I would check to make sure your android has good router and dns
>>> settings, and that port 3306 is not firewalled somewhere.
>>>>> the tablet he tested on is in the same network (WiFi) as the Mac and PC
>>> with LC where this works.
>>>>>> Also try and ping the hostname from somewhere outside the hosts local
>>> network, it doesn’t matter where. You should at least get DNS resolution.
>>> If not, your public DNS records for the host are not good.
>>>>>> 
>>>>>> Bob S

Best

Klaus
--
Klaus Major
https://www.major-k.de
https://www.major-k.de/bass
klaus at major-k.de



More information about the use-livecode mailing list