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

Discussion in 'Python' started by iMath, Oct 17, 2012.

  1. iMath

    iMath Guest

    host name : localhost
    user name:root
    password:19910512
    database name : shopping
     
    iMath, Oct 17, 2012
    #1
    1. Advertising

  2. On Tue, 16 Oct 2012 18:36:13 -0700 (PDT), iMath <>
    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
    HTTP://wlfraed.home.netcom.com/
     
    Dennis Lee Bieber, Oct 17, 2012
    #2
    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. MacRules
    Replies:
    9
    Views:
    833
    Dennis Lee Bieber
    Sep 5, 2009
  2. Larry Martell

    pyodbc connect string

    Larry Martell, Apr 30, 2014, in forum: Python
    Replies:
    0
    Views:
    59
    Larry Martell
    Apr 30, 2014
  3. Chris Angelico

    Re: pyodbc connect string

    Chris Angelico, Apr 30, 2014, in forum: Python
    Replies:
    0
    Views:
    60
    Chris Angelico
    Apr 30, 2014
  4. Larry Martell

    Re: pyodbc connect string

    Larry Martell, Apr 30, 2014, in forum: Python
    Replies:
    0
    Views:
    72
    Larry Martell
    Apr 30, 2014
  5. Larry Martell

    Re: pyodbc connect string

    Larry Martell, Apr 30, 2014, in forum: Python
    Replies:
    0
    Views:
    62
    Larry Martell
    Apr 30, 2014
Loading...

Share This Page