Home arrow Python arrow Database Programming in Python: Accessing MySQL

Database Programming in Python: Accessing MySQL

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.

TABLE OF CONTENTS:
  1. Database Programming in Python: Accessing MySQL
  2. Accessing MySQL, Step By Step
  3. Accessing MySQL, Step by Step continued
  4. Accessing MySQL in the Real World
By: A.P.Rajshekhar
Rating: starstarstarstarstar / 49
February 21, 2006

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

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
 

blog comments powered by Disqus
   

PYTHON ARTICLES

- Python Big Data Company Gets DARPA Funding
- Python 32 Now Available
- Final Alpha for Python 3.2 is Released
- Python 3.1: String Formatting
- Python 3.1: Strings and Quotes
- Python 3.1: Programming Basics and Strings
- 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

Developer Shed Affiliates

 



© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap

Dev Shed Tutorial Topics: