简体   繁体   English

如何连接android与phpmyadmin

[英]how to connect android with phpmyadmin

How to connect android with phpmyadmin?如何将 android 与 phpmyadmin 连接? I used Android Studio and WAMP server, I searched relative information, but I could not know how to pick out which one is useful for me.我用过Android Studio和WAMP服务器,查了相关资料,不知道怎么挑哪个对我有用。 I could insert data into mysql with php.file, and query the data from mysql.我可以使用php.file 将数据插入到mysql 中,并从mysql 中查询数据。 But I don't know how to connect Android with Phpmyadmin, how to upload/ download from mysql.但是我不知道如何将Android与Phpmyadmin连接,如何从mysql上传/下载。

  1. Connect Android phone and Computer to the same network将安卓手机和电脑连接到同一个网络
  2. In mobile browser, type the IP address of the computer with port number在手机浏览器中输入电脑的IP地址和端口号
  3. Enter phpMyAdmin credentials and access WAMP projects输入 phpMyAdmin 凭据并访问 WAMP 项目

Please change http://localhost/ .... with http://10.0.2.2/ .... in your urls configurations请将http://localhost/ .... 更改为http://10.0.2.2/ .... 在您的 urls 配置中

EDIT : if you use a real Android device, search the IP adress of your computer in your router main page configuration and replace localhost by this ip adress, it will work编辑:如果您使用真正的Android设备,请在路由器主页配置中搜索您计算机的IP地址并将本地主机替换为该IP地址,它将起作用

phpMyAdmin is not a database, it's a web-based application from which you can perform administrative tasks on a MySQL (or MariaDB) database. phpMyAdmin 不是一个数据库,它是一个基于 Web 的应用程序,您可以从中对 MySQL(或 MariaDB)数据库执行管理任务。

If you're really trying to connect to phpMyAdmin, just enter the URL in to the web browser.如果您真的想连接到 phpMyAdmin,只需在 Web 浏览器中输入 URL。 https://example.com/phpmyadmin or https://192.0.2.52/phpmyadmin or something similar. https://example.com/phpmyadminhttps://192.0.2.52/phpmyadmin或类似的东西。

However, if you're trying to get an application on your Andriod device to talk to a MySQL database hosted somewhere else, you're not going to want to connect directly to it, you'll want an API running on the database machine to authenticate, handle incoming requests, and return appropriate responses.但是,如果您试图让 Andriod 设备上的应用程序与托管在其他地方的 MySQL 数据库对话,您不会想要直接连接到它,您需要在数据库机器上运行的 API进行身份验证、处理传入请求并返回适当的响应。 You can code that in PHP if you want, or whatever programming language suits you, then you access that URL from your Android app.如果需要,您可以使用 PHP 或任何适合您的编程语言对其进行编码,然后您可以从您的 Android 应用程序访问该 URL。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM