mysql python Newbie Question

Discussion in 'Python' started by djw, Jan 3, 2004.

  1. djw

    djw Guest

    Andrew wrote:
    > Hi I would like to create a program that accesses mysql from a gui on my
    > local computer "mysql is on a server"
    >
    > but I am fairly new to python and programming GUI's in general
    >
    > What I would like this program to do is be able to access my server and
    > change update add and delete records from my databases without having to
    > write sql.
    >
    > I can create the GUI fairly easily but I do not know how I or what functions
    > and modules would be needed to do this or how to write them "Forgive me if I
    > sound to Newb"
    >
    > If someone out there could help me out maybe offer advice or even better
    > some code to build on that would be cool
    >
    > Thanks in advance
    >
    > Cheers
    >
    > Andrew
    >
    >

    Quick google search of "python mysql" yields:

    http://sourceforge.net/projects/mysql-python

    Google of "python mysql example" yields:

    http://www.devshed.com/Server_Side/Python/PythonMySQL/print_html


    Moral: Google is your friend.

    -D
     
    djw, Jan 3, 2004
    #1
    1. Advertising

  2. djw

    Lol McBride Guest

    On Sat, 03 Jan 2004 17:50:03 -0800, Andrew wrote:

    > Hi I would like to create a program that accesses mysql from a gui on my
    > local computer "mysql is on a server"
    >
    > but I am fairly new to python and programming GUI's in general
    >
    > What I would like this program to do is be able to access my server and
    > change update add and delete records from my databases without having to
    > write sql.
    >
    > I can create the GUI fairly easily but I do not know how I or what functions
    > and modules would be needed to do this or how to write them "Forgive me if I
    > sound to Newb"
    >
    > If someone out there could help me out maybe offer advice or even better
    > some code to build on that would be cool
    >
    > Thanks in advance
    >
    > Cheers
    >
    > Andrew

    Hi Andrew,
    I think you'll find that you still have to master SQL and it's
    nonclementure as Python only provides a DB-API and you need to know the
    SQL in order to use the API to send your queries etc.
    I've recently started using it and although at first SQL seems daunting
    you do get the hang of it after time - like most languages really.If you
    need specific help get in touch and I'll help were I can.
    Lol McBride
     
    Lol McBride, Jan 3, 2004
    #2
    1. Advertising

  3. In article <>, Andrew wrote:

    > Hi I would like to create a program that accesses mysql from a gui on my
    > local computer "mysql is on a server"
    >
    > but I am fairly new to python and programming GUI's in general
    >
    > What I would like this program to do is be able to access my server and
    > change update add and delete records from my databases without having to
    > write sql.


    You might give an object-relation mapper like SQLObject or MiddleKit a try.

    http://www.thinkware.se/cgi-bin/thinki.cgi/ObjectRelationalMappersForPython

    However, SQL is easy to learn and is very useful since you still may need to
    tweek the schemas that these ORMs produce for you.

    Also, SQLObject seems quite slow, though maybe I'm just using it wrong.

    It should also be said that SQL is simply one of those things that
    programmers are expected to know.

    Another option is MetaKit, which is procedural as opposed to descriptive, e.g.

    SQL: select * from person p, address a where p.person_id=a.person_id;

    MK: vw = person.join(address, person_id)

    Dave Cook
     
    David M. Cook, Jan 3, 2004
    #3
  4. djw

    Andrew Guest

    Hi I would like to create a program that accesses mysql from a gui on my
    local computer "mysql is on a server"

    but I am fairly new to python and programming GUI's in general

    What I would like this program to do is be able to access my server and
    change update add and delete records from my databases without having to
    write sql.

    I can create the GUI fairly easily but I do not know how I or what functions
    and modules would be needed to do this or how to write them "Forgive me if I
    sound to Newb"

    If someone out there could help me out maybe offer advice or even better
    some code to build on that would be cool

    Thanks in advance

    Cheers

    Andrew
     
    Andrew, Jan 4, 2004
    #4
  5. "Andrew" <na> fed this fish to the penguins on Sunday 04 January 2004
    17:35 pm:

    >
    > how do I connect to a DB server that is not on my computer through
    > python to access my records.
    >

    Well, in most cases, in the same way you connect to a local server...
    You specify the host (or IP) address of the machine running the server
    (and maybe the port number if it is not on the standard port) when
    issuing the connect call.

    --
    > ============================================================== <
    > | Wulfraed Dennis Lee Bieber KD6MOG <
    > | Bestiaria Support Staff <
    > ============================================================== <
    > Bestiaria Home Page: http://www.beastie.dm.net/ <
    > Home Page: http://www.dm.net/~wulfraed/ <
     
    Dennis Lee Bieber, Jan 4, 2004
    #5
  6. "Andrew" <na> fed this fish to the penguins on Monday 05 January 2004
    09:17 am:

    >
    >
    > Ok I was able to connect to my local server but how do I find the host
    > address or port number of my remote server
    >

    Ask the people who own/run the server? {I know, there is an air of a
    "sneer" in that question -- but your current questions are no longer
    Python related, they apply to /any/ application trying to connect to
    the server}

    If it is a hosting service, you could be out of luck -- the MySQL port
    may be blocked by a firewall so that only HTTP (and maybe FTP) requests
    can come in, with all MySQL access assumed to be performed using
    scripts that are /on/ the server already.


    --
    > ============================================================== <
    > | Wulfraed Dennis Lee Bieber KD6MOG <
    > | Bestiaria Support Staff <
    > ============================================================== <
    > Bestiaria Home Page: http://www.beastie.dm.net/ <
    > Home Page: http://www.dm.net/~wulfraed/ <
     
    Dennis Lee Bieber, Jan 4, 2004
    #6
  7. djw

    Andrew Guest

    Hi everyone and thank you for replying to my post

    My question was answered I need the python mysql modules for my program from
    what I understand

    I was just interested in building an app that could connect to my server and
    edit records in my database through a Graphical User Interface

    As for not knowing sql:
    I have a good grasp on MySQL although I am not the best I could be I know
    where to look for the information. Basically I could do the things I needed
    for my application

    what my question should have been:

    how do I connect to a DB server that is not on my computer through python to
    access my records.

    from What I understand I need to look at the Python Mysql documentation (If
    there is any) and build from there

    If there are any other modules or documentation I need to look at please let
    me know

    Thank You

    Andrew
     
    Andrew, Jan 5, 2004
    #7
  8. djw

    Andrew Guest

    Ok I was able to connect to my local server but how do I find the host
    address or port number of my remote server

    The host address I usually use is localhost on my remote server

    I searched google several times but could not find a way to look it up
    since my site uses php I tried phpinfo() but it did not show me anything

    I found the ip address of my web site through nslookup

    and tried to make a connection with that but to know avail

    How do I lookup my host ipaddress and mysql port

    Thanks in advance

    Andrew



    "Dennis Lee Bieber" <> wrote in message
    news:...
    > "Andrew" <na> fed this fish to the penguins on Sunday 04 January 2004
    > 17:35 pm:
    >
    > >
    > > how do I connect to a DB server that is not on my computer through
    > > python to access my records.
    > >

    > Well, in most cases, in the same way you connect to a local

    server...
    > You specify the host (or IP) address of the machine running the server
    > (and maybe the port number if it is not on the standard port) when
    > issuing the connect call.
    >
    > --
    > > ============================================================== <
    > > | Wulfraed Dennis Lee Bieber KD6MOG <
    > > | Bestiaria Support Staff <
    > > ============================================================== <
    > > Bestiaria Home Page: http://www.beastie.dm.net/ <
    > > Home Page: http://www.dm.net/~wulfraed/ <

    >
     
    Andrew, Jan 5, 2004
    #8
  9. djw

    Andrew Guest

    Ok Thank You




    "Dennis Lee Bieber" <> wrote in message
    news:...
    > "Andrew" <na> fed this fish to the penguins on Monday 05 January 2004
    > 09:17 am:
    >
    > >
    > >
    > > Ok I was able to connect to my local server but how do I find the host
    > > address or port number of my remote server
    > >

    > Ask the people who own/run the server? {I know, there is an air of

    a
    > "sneer" in that question -- but your current questions are no longer
    > Python related, they apply to /any/ application trying to connect to
    > the server}
    >
    > If it is a hosting service, you could be out of luck -- the MySQL

    port
    > may be blocked by a firewall so that only HTTP (and maybe FTP) requests
    > can come in, with all MySQL access assumed to be performed using
    > scripts that are /on/ the server already.
    >
    >
    > --
    > > ============================================================== <
    > > | Wulfraed Dennis Lee Bieber KD6MOG <
    > > | Bestiaria Support Staff <
    > > ============================================================== <
    > > Bestiaria Home Page: http://www.beastie.dm.net/ <
    > > Home Page: http://www.dm.net/~wulfraed/ <

    >
     
    Andrew, Jan 5, 2004
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. JL
    Replies:
    0
    Views:
    1,149
  2. Ravi
    Replies:
    6
    Views:
    1,412
    Suchandra Thapa
    Jul 21, 2003
  3. Replies:
    2
    Views:
    6,199
  4. washakie
    Replies:
    4
    Views:
    926
    washakie
    Jan 15, 2008
  5. dave
    Replies:
    4
    Views:
    1,373
    Steve Holden
    Nov 18, 2010
Loading...

Share This Page