One of the best parts of programming is you are always learning something new. I happened to build a simple statistics application with MySQL as the database. For practice , I decided to revert to Python since doing lot of coding in PHP and Perl. I was lazy enough to decide to add MySQL connectivity to Python on my Windows 7 (32-bit) box and found that I had a range of issues.
To cut the long story short...here is a summary for anyone who wants to use MySQLdb(Python MySQL driver) on windows.
I installed Python 2.7.1 on Windows which is a simple install from python.org. I installed MySQL Server 5.1 which is a simple msi file install.I then hit some snags with getting MySQLdb to work with Python. So this tutorial is truly for these versions.
To cut the long story short...here is a summary for anyone who wants to use MySQLdb(Python MySQL driver) on windows.
I installed Python 2.7.1 on Windows which is a simple install from python.org. I installed MySQL Server 5.1 which is a simple msi file install.I then hit some snags with getting MySQLdb to work with Python. So this tutorial is truly for these versions.
- Install Python 2.7.1. I installed into "C:\Python27". Make sure you set yout "PATH" environment variable and compile Python with a simple "hello world!" program.
- Install MySQL Server5.x. Again make sure that MySQL can be accessed via command line by adding the MySQL Server bin folder to the "PATH" variable
- Do not download and compile the MySQL Python Drivers. You will waste time. Instead get precompiled executables from : http://www.lfd.uci.edu/~gohlke/pythonlibs/
- Double click on the exe after download and choose the python folder which was "C:\Python27" in my case. This will install the MySQLdb connector
- Start Python IDLE(GUI editor) and type "import MySQLdb". If you dont see any errors, you are ready to use the MySQL connector.
1 comment:
hey where i insert mysql file?is it in same python folder or other folder in C driver
Post a Comment