mysql python Newbie Question

D

djw

Andrew said:
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
 
L

Lol McBride

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
 
D

David M. Cook

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
 
A

Andrew

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
 
D

Dennis Lee Bieber

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.

--
 
D

Dennis Lee Bieber

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.


--
 
A

Andrew

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
 
A

Andrew

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
 
A

Andrew

Ok Thank You




Dennis Lee Bieber said:
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top