Python
  Home arrow Python arrow Database Programming in Python: Access...
Dev Shed Forums 
Administration  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Download TestComplete 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
eWeek
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PYTHON

Database Programming in Python: Accessing MySQL
By: A.P.Rajshekhar
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 20
    2006-02-21

    Table of Contents:
  • Database Programming in Python: Accessing MySQL
  • Accessing MySQL, Step By Step
  • Accessing MySQL, Step by Step continued
  • Accessing MySQL in the Real World

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
     
    ADVERTISEMENT

    Application developers can seamlessly integrate the Advantage Database install with their application install. Learn the best practices used when setting up silent installs with this seminar.

    Database Programming in Python: Accessing MySQL
    (Page 1 of 4 )

    While data storage for applications is no longer considered complex, it is now simplified to the point that flexibility is sacrificed. There is a good compromise, however. In this article, you will learn how to access a a MySQL database with Python.

    Data forms the base of all application programs. Whatever the domain, the core of the application's logic goes into extraction, processing, storage and presentation of the data. Each of these has evolved into a specialized domain of its own.

    If storage is the context, then anything from persisting data to a file to persisting it into a database can become a part of the core logic. In the early days of programming, any level of storage of data was considered complicated, especially in databases. However in this era of Very High Level Programming Languages, complexity has become a thing of past (almost).

    The major issue with VHLL is that most of them sacrifice flexibility for simplicity. Equilibrium between flexibility and simplicity must exist so that data-bound applications need not be termed either complex or user-unfriendly.  This is where languages such as Python play a pivotal role.

    The beauty of Python is that it can provide abstraction in data access and processing at various levels. In other words, Python provides for database access both at the SQL level as well as at the object level and to almost any database.

    That justifies the first part of this article's title. Coming to the second part, of all the relational databases, MySQL is the best bet. There are two reasons. The first one is that MySQL is free. The second one is that MySQL is comparatively less resource hungry. Hence, a Python-MySQL combination is a good option for a data-bound application.

    The first sections of this article will deal with the steps required for connecting with and retrieving data from MySQL. In the last section I will put  the theory into practice by applying it in a real-world example. That’s the agenda for this discussion.

    More Python Articles
    More By A.P.Rajshekhar


       · HiThanks for reading my article. Hope it has been helpful. If you have any topics...
       · nice tutorial. I'd love to see one on postgresql, as I plan to be using it in the...
       · Thank you for your encouragement. As for pgsql you can use pgdb from...
       · I would make the criticism that it was probably too hard to follow if you haven't...
       · Thank you for your commnets. But I would like to clarify certain things. Firstly the...
       · We would like to see more articles about SQL type programming in Python.Thanks a...
       · Would love to see any article that helps beginner (but already with enough...
       · The link is not available anymore ? I mean, the full article.
       · HiThe link is still there. You can access it from the following link...
     

       

    PYTHON ARTICLES

    - SSH with Twisted
    - Mobile Programming in Python using PyS60: UI...
    - Python: Count on It
    - Python Strings: Spinning Yarns
    - Python: More Fun with Strings
    - Python: Stringing You Along
    - Python Operators
    - Bluetooth Programming in Python: Network Pro...
    - Python Sets
    - Python Conditionals, Lists, Dictionaries, an...
    - Python: Input and Variables
    - Introduction to Python Programming
    - Mobile Programming in Python using PyS60: Ge...
    - Bluetooth Programming using Python
    - Finishing the PyMailGUI Client: User Help To...




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway