Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #31443 > unrolled thread

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

Started byiMath <redstone-cold@163.com>
First post2012-10-16 18:36 -0700
Last post2012-10-16 23:18 -0400
Articles 2 — 2 participants

Back to article view | Back to comp.lang.python


Contents

  how to  use pyODBC to connect to MySql ,please give me a sample iMath <redstone-cold@163.com> - 2012-10-16 18:36 -0700
    Re: how to  use pyODBC to connect to MySql ,please give me a sample Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-10-16 23:18 -0400

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

FromiMath <redstone-cold@163.com>
Date2012-10-16 18:36 -0700
Subjecthow to use pyODBC to connect to MySql ,please give me a sample
Message-ID<e89cd234-15ac-42c5-86d0-5be2e86b6a6d@googlegroups.com>
 host name : localhost
user name:root
 password:19910512
database name : shopping

[toc] | [next] | [standalone]


#31455

FromDennis Lee Bieber <wlfraed@ix.netcom.com>
Date2012-10-16 23:18 -0400
Message-ID<mailman.2313.1350443902.27098.python-list@python.org>
In reply to#31443
On Tue, 16 Oct 2012 18:36:13 -0700 (PDT), iMath <redstone-cold@163.com>
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/en/connector-odbc-examples-walkthrough.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
        wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web