Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8742931
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:35:14+00:00 2026-06-13T11:35:14+00:00

Is there a nice and simple interface between Python and MySQL? I’ve looked at

  • 0

Is there a nice and simple interface between Python and MySQL? I’ve looked at MySQLdb module, SQLAlchemy, and the module provided by MySQL. They work, but are just clunky and difficult to quickly work with. I’m brand new to Python, but I’ve done this in MATLAB and they have an incredibly easy interface. I.E.

Every time you want to perform a query in Python it seems like you have to do something like:

import datetime
import mysql.connector
cnx = mysql.connector.connect(user='scott', database='employees')
cursor = cnx.cursor()
query = ("SELECT first_name, last_name, hire_date FROM employees "
     "WHERE hire_date BETWEEN %s AND %s")
hire_start = datetime.date(1999, 1, 1)
hire_end = datetime.date(1999, 12, 31)
cursor.execute(query, (hire_start, hire_end))
for (first_name, last_name, hire_date) in cursor:
print("{}, {} was hired on {:%d %b %Y}".format(
last_name, first_name, hire_date))
cursor.close()
cnx.close()

Whereas in MATLAB, I initiate the connection once (like when starting up the program, and then retrieving something is as simple as (from here):

[Fn,Ln,Hd] = mysql(['SELECT first_name, last_name, hire_date FROM employees WHERE hire_date = ',num2str(some_date)])

No cursors and connections to make every time you query, just a simple I/O query executer and data returner. I like playing with databases and have many cross-platform projects. Being able to instantly connect to and look at data in MATLAB is an awesome feature. Is there a Python bridge to do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T11:35:15+00:00Added an answer on June 13, 2026 at 11:35 am

    Use Pandas. It has a great interface. Look here:

    python-pandas and databases like mysql

    I use it to access all my databases from python.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Apple has a nice little tutorial for making a simple master-detail interface. Interface Builder
A nice simple question: Is there something similar to http://studiostyl.es/ for Eclipse? Update :
There are nice SO question and answers about this issue, but these options didn't
Is there a nice way in the WinAPI to get a path relative to
Are there any nice libraries to render text in an image for Java? Java
Is there a nice way in Ext to move elements in DOM? I want
In Spring Source Toolsuite (Eclipse with some Spring tuning) there is nice wizard to
I want to swap both references, is there a nice way make such a
I got some binary files containing integers. Is there some nice Unix command, that
There's a nice F# workflow builder for Rx here: http://blogs.msdn.com/b/dsyme/archive/2011/05/30/nice-f-syntax-for-rx-reactive-extensions.aspx I've been trying to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.