Python
  Home arrow Python arrow Database Programming in Python: Accessing MySQL
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 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: starstarstarstarstar / 32
    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:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log 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


    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
     

       

    PYTHON ARTICLES

    - Tuples and Other Python Object Types
    - The Dictionary Python Object Type
    - String and List Python Object Types
    - Introducing Python Object Types
    - Mobile Programming using PyS60: Advanced UI ...
    - Nested Functions in Python
    - Python Parameters, Functions and Arguments
    - Python Statements and Functions
    - Statements and Iterators in Python
    - Sequences and Sets in Python
    - Python Expressions and Operators
    - Dictionaries, Variables and Statements in Py...
    - Data Types in Python
    - The Python Language
    - SSH with Twisted





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
    Stay green...Green IT