Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > how to use pyODBC to connect to MySql ,please give me a sample

Reply
Thread Tools

how to use pyODBC to connect to MySql ,please give me a sample

 
 
iMath
Guest
Posts: n/a
 
      10-17-2012

host name : localhost
user name:root
password:19910512
database name : shopping
 
Reply With Quote
 
 
 
 
Dennis Lee Bieber
Guest
Posts: n/a
 
      10-17-2012
On Tue, 16 Oct 2012 18:36:13 -0700 (PDT), iMath <redstone->
declaimed the following in gmane.comp.python.general:

>
> host name : localhost
> user name:root
> password:19910512
> database name : shopping


Have you looked at
http://code.google.com/p/pyodbc/wiki/GettingStarted

ODBC is an intermediary system... That is, the application (in this
case, the code using pyODBC) connects to a defined "data source" managed
by the OS-common ODBC system. The OS-common portion uses information in
the data source to connect to the database-specific ODBC backend.

In the case of MySQL, that means you need to have
http://dev.mysql.com/downloads/connector/odbc/ installed also, and then
define the datasource
http://dev.mysql.com/doc/refman/5.1/...lkthrough.html
(this means using, if you are on Windows, using Control
Panel/Administrative Tools/Data Sources(ODBC) to create either a User
DSN or a System DSN. When you click "Add", you will be given a list of
ODBC drivers -- pick the MySQL ODBC driver... Then continue with
configuring the host, database name, etc.)

{If you aren't on Windows, you should normally be able to bypass the
MySQL ODBC connector and go directly to the server using UNIX pipes, or
some such -- read the Connector documentation or MySQL documentation for
details}



--
Wulfraed Dennis Lee Bieber AF6VN
HTTP://wlfraed.home.netcom.com/

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
python daemon - compress data and load data into MySQL by pyodbc MacRules Python 9 09-05-2009 04:27 AM
I wanna use urllib2 to get a page with a socks 5 proxy,who can give me a sample code ? Ju Hui Python 4 04-13-2006 02:56 AM
installing pyodbc timw.googlepost Python 0 04-11-2006 06:39 PM
Seen this message? Can't connect to local MySQL server through socket '/tmp/mysql.sock' Allen Marshall Perl Misc 1 01-24-2004 10:55 PM



Advertisments