[英]How to access mysql database from Android device without internet connectivity?
I am implementing an app which has a database that contains millions of values and is located on a PC(Server) .我正在实现一个应用程序,它有一个包含数百万个值的数据库,位于 PC(Server) 上。 Now provided, I won't have an active internet connection, what option do I have to connect with the mysql database?
现在提供,我将没有活动的互联网连接,我必须使用什么选项来连接 mysql 数据库? Is it possible to implement this using a wireless LAN?
是否可以使用无线 LAN 来实现?
如果您必须离线访问,我唯一的想法是将数据加载到 xml 或 JSON 文件中,尽管这不是一种有效或安全的方式(取决于您的数据是什么),这可能是您的一个选择
Yes you can connect it without the internet all you have to do is start the Wifi hotspot of your mobile device and connect your laptop to the wifi network of your mobile是的,您可以在没有互联网的情况下连接它,您所要做的就是启动移动设备的 Wifi 热点并将笔记本电脑连接到手机的 wifi 网络
the mobile and the PC(server)should be on the same network assuming that you are using XAMPP server go to the folder where you installed XAMPP on PC and search for httpd-xampp config file inside XAMPP\\apache\\conf\\extra假设您使用的是 XAMPP 服务器,移动设备和 PC(服务器)应该在同一网络上,转到您在 PC 上安装 XAMPP 的文件夹,并在 XAMPP\\apache\\conf\\extra 中搜索 httpd-xampp 配置文件
<LocationMatch "^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))">
# Require local
ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</LocationMatch>
find and comment the Require local查找并评论 Require local
Now grant the privileges to the database user to connect with % ie any host现在授予数据库用户连接 % 即任何主机的权限
Open Command Prompt and type ipconfig there you will find the IpV4 address打开命令提示符并在那里输入 ipconfig 你会发现 IpV4 地址
use that address for the connection string ie.将该地址用于连接字符串,即。
connection=DriverManager.getConnection("jdbc:mysql://192.168.x.xxx/databasename","username","password");
and you can connect get the connection to the database你可以连接获取到数据库的连接
Android with mysql connectivity without JSON or PHP Android with mysql connectivity带有 mysql 连接的 Android 没有 JSON 或 PHP带有 mysql 连接的 Android
Yes you can do it using wireless Lan.是的,您可以使用无线局域网来实现。
check this link: https://blogs.msdn.microsoft.com/varund/2010/09/02/create-a-sql-server-database-on-a-network-shared-drive/检查此链接: https : //blogs.msdn.microsoft.com/varund/2010/09/02/create-a-sql-server-database-on-a-network-shared-drive/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.