1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2013
    Rep Power

    Python get data from external MYSQL

    I have a website running with users and infromation about them.


    I can not connect directly to the MYSQL from external locations. (Server in datacenter / python script on mobile device)

    What I need to do is the following:

    1. Get username and information from the database using the Python script.
    2. Send data back to the MYSQL

    The second part can be done by opening a page like:


    Only before I can send the user id i have to get it in the python script. And at this part i'm getting lost.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2010
    Rep Power
    So, it sounds to me like what you really need to write here is a web service with which your Python script can communicate. Nowadays this is usually done by implementing a RESTful service on the web server side, and interchanging JSON formatted data using standard HTTP requests.

    On the python side, you probably want to look into using the requests library to make your http requests to the server.

IMN logo majestic logo threadwatch logo seochat tools logo