简体   繁体   中英

how access mysql remote database

im creating inapp purchage subscription module, in this app i want to access remote database but problem is that how i connect my objective-c code with the mysql on the server,

i am not found any sufficient refrence please help me if any refrence or solution is there.

In mySQL, all access from your application to the database server is already remote access. Local access is simply one case of remote access.

If you're working locally, you may be using "localhost" or "127.0.0.1" as the hostname for your data base, and 3306 as the port number. You're using the data base name you set up on your local server, perhaps "arunsdata" or some such thing

You need to find out the hostname and port number of the remote data base server. (The port number is probably 3306.) Then you need to modify your application code to specify that hostname and port number.

Before you do that you will need to have a username and password, and create your data base ("arunsdata" or whatever) on the remote data base and create your tables and other schema items. The administrator of the remote database server can probably help you with this.

Good luck! I remember how confusing this was the first time I faced it. It's simpler than it seems.

You should probably create a web service to access the remote mySQL server database. You can then send a request to the service using NSMutableURLRequest. If you need to return data back, return json since its more light weight than XML.

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