donglugou6652 2015-03-14 06:54
浏览 85

Android可以在没有PHP的情况下直接连接MySQL吗?

  1. I want to connect to MySQL remote database from android but I don't want to send request to php, I want a straight connection to MySQL without making request to php, so in my opinion it will be more fast and I will get everything i need from mysql remote db table, but as far as I google only tutorials on how to connect through request to php. Is it even possible to do what I want?
  2. If the first one isn't possible, could Android have local database SQLite in which straight away in android code I can wire queries to that db, but is it possible to write queries inside android code to remote mysql database?
  • 写回答

2条回答 默认 最新

  • duanjue7508 2015-03-14 07:05
    关注

    It is strongly recommended that you don't do this.

    See this post: Direct insert data in mysql data in android

    ... and this post: Why should a developer use web services instead of direct connections to a db?

    Edit: The comment from @halfer is very informative, so quoting it here:

    In practice, you will always need more security controls than MySQL will give you - hence the need for a server-side layer. If it gets slow then you can optimise your queries or upgrade your hardware (but don't optimise unless you need to).

    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog