简体   繁体   中英

iPhone connect to MySQL database on local network computer

I'm a bit of a noob to iPhone programming and I've read up on using PHP as the connection between an iPhone app and a remotely hosted MySQL database, but what I need to do is to connect directly to a MySQL database running on a local machine in my office. The machine is behind the same gateway and has an ip address similar to 192.169.xx Is that possible without PHP in the middle or anything else for that matter? Thanks in advance. Really appreciate this site.

Check out http://www.karlkraft.com/index.php/2010/09/17/mysql-for-iphone-and-osx/ - that's an Objective-C library for accessing MySQL.

The conventional approach is to have your iPhone app POST or GET pages on a web interface that you separately program to access your data, but if you have your own reasons to bypass that, this approach should work.

An alternative would be for you to code the socket communications yourself (3306 to MySQL) - in effect, developing your own library of interface routines to MySQL. In either case, you have to be aware that you're exposing your MySQL interface to some serious vulnerabilities by putting it on the open Internet instead of mediating access through your own PHP code. YMMV.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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