Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #100293
| Path | csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail |
|---|---|
| From | Larry Martell <larry.martell@gmail.com> |
| Newsgroups | comp.lang.python |
| Subject | Re: How to connect the MYSQL database to Python program? |
| Date | Fri, 11 Dec 2015 13:51:46 -0500 |
| Lines | 30 |
| Message-ID | <mailman.155.1449859955.12405.python-list@python.org> (permalink) |
| References | <a1dc235b-b02e-40c6-adb7-9c280833372b@googlegroups.com> <mailman.98.1449683869.12405.python-list@python.org> <9261e7b4-48ad-45f2-ba65-066177d21f6b@googlegroups.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8 |
| X-Trace | news.uni-berlin.de +ISQbzLqV07oGCF6d72p0gxg4bg6mCO2+1qQTEFPHTvw== |
| Return-Path | <larry.martell@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.002 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; 'received:209.85.223': 0.03; 'subject:Python': 0.05; 'wednesday,': 0.07; 'subject:How': 0.09; 'python': 0.10; 'thu,': 0.15; 'db)': 0.16; 'program?': 0.16; 'pypi.': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:program': 0.16; 'wrote:': 0.16; 'module,': 0.18; '2015': 0.20; 'to:name:python-list@python.org': 0.20; 'correctly.': 0.22; 'am,': 0.23; 'dec': 0.23; 'this:': 0.23; 'import': 0.24; 'header :In-Reply-To:1': 0.24; 'module': 0.25; 'installed': 0.26; 'chris': 0.26; 'skip:m 30': 0.27; 'fri,': 0.27; 'skip:# 10': 0.27; 'message-id:@mail.gmail.com': 0.27; 'connection': 0.30; 'that.': 0.30; 'code': 0.30; 'december': 0.32; 'lets': 0.33; 'open': 0.33; 'received:google.com': 0.35; 'done': 0.35; 'should': 0.36; 'received:209.85': 0.36; 'to:addr:python-list': 0.36; 'subject:?': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'received:209': 0.38; 'subject:the': 0.39; 'to:addr:python.org': 0.40; 'your': 0.60; 'user,': 0.67; 'chrisa': 0.84; 'ict': 0.84 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=XACjrCYWx+fYgh7cpH1nDmoTEEd/G0RTqST3sNke+o4=; b=GMCMRESEeGPoU2/8iLOJeLC78+Ho55tVhgw9Y+uWArzmQURqXJTctj7WdYv0bptS+y 9vbbVpVLLAbX8qsFAZndpjizEQXatgmA1vuZ5apbR6j1WRGsIo7l6z17tH5SDJE9DwJ6 7D016zLsh1d7oO2Wwcz5o/6cLERzuMCobMMYxrZ+8rxiExYtj5GAxnnhOOa/IQ+4LF5s X0pgvSWnkGDwkoQWr4w6DqSr6cvznub/XbG/bpSC5hWoQXGcBYUp2w22cYMvDxjjiaKV 2+B4zAzKxpzjhTEaxizYzzGjwwg0Wl0pl828ce0kZhmJJiE6pusOs6DN7HqKbAi+FlEJ Y6pA== |
| X-Received | by 10.107.28.144 with SMTP id c138mr18471041ioc.15.1449859946644; Fri, 11 Dec 2015 10:52:26 -0800 (PST) |
| In-Reply-To | <9261e7b4-48ad-45f2-ba65-066177d21f6b@googlegroups.com> |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.20+ |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Xref | csiph.com comp.lang.python:100293 |
Show key headers only | View raw
On Fri, Dec 11, 2015 at 1:36 PM, ICT Ezy <ictezy@gmail.com> wrote:
> On Wednesday, December 9, 2015 at 9:58:02 AM UTC-8, Chris Angelico wrote:
>> On Thu, Dec 10, 2015 at 4:51 AM, ICT Ezy <ictezy@gmail.com> wrote:
>> > Pl explain me how to connect the MYSQL database to Python program?
>>
>> You start by looking for a module that lets you do that. You can use
>> your favourite web search engine, or go directly to PyPI.
>>
>> Then you learn how to use that module, including learning SQL if you
>> don't already know it.
>>
>> ChrisA
>
> Now, I installed MYSQLDB and following code was done correctly.
>
> #!/usr/bin/python
>
> import MySQLdb
>
> # Open database connection
> db = MySQLdb.connect("localhost","TESTDB")
The connect should look like this:
db= MySQLdb.connect(host, user, passwd, db)
Or to be clearer:
db= MySQLdb.connect(host="localhost", user="user", passwd="password",
db="TESTDB")
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
How to connect the MYSQL database to Python program? ICT Ezy <ictezy@gmail.com> - 2015-12-09 09:51 -0800
Re: How to connect the MYSQL database to Python program? Chris Angelico <rosuav@gmail.com> - 2015-12-10 04:57 +1100
Re: How to connect the MYSQL database to Python program? ICT Ezy <ictezy@gmail.com> - 2015-12-11 10:36 -0800
Re: How to connect the MYSQL database to Python program? ICT Ezy <ictezy@gmail.com> - 2015-12-11 10:39 -0800
Re: How to connect the MYSQL database to Python program? Larry Martell <larry.martell@gmail.com> - 2015-12-11 13:51 -0500
Re: How to connect the MYSQL database to Python program? ICT Ezy <ictezy@gmail.com> - 2015-12-11 11:00 -0800
Re: How to connect the MYSQL database to Python program? Igor Korot <ikorot01@gmail.com> - 2015-12-11 14:11 -0500
Re: How to connect the MYSQL database to Python program? ICT Ezy <ictezy@gmail.com> - 2015-12-11 11:13 -0800
Re: How to connect the MYSQL database to Python program? ICT Ezy <ictezy@gmail.com> - 2015-12-11 11:11 -0800
Re: How to connect the MYSQL database to Python program? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-12-09 21:42 +0000
Re: How to connect the MYSQL database to Python program? ICT Ezy <ictezy@gmail.com> - 2015-12-11 10:35 -0800
Re: How to connect the MYSQL database to Python program? ICT Ezy <ictezy@gmail.com> - 2015-12-11 10:39 -0800
csiph-web