{"id":257,"hash":"f96263af376444ebde47c0108529b6ed16bf58af0ef9bb14d1fb9ecda8bfd357","pattern":"ImportError: No module named MySQLdb","full_message":"I am referring the following tutorial to make a login page for my web application.\nhttp://code.tutsplus.com/tutorials/intro-to-flask-signing-in-and-out--net-29982\n\nI am having issue with the database.\nI am getting an \n\nImportError: No module named MySQLdb\n\nwhen I execute  \n\nhttp://127.0.0.1:5000/testdb\n\nI have tried all possible ways to install python mysql, the one mentioned in the tutorial, easy_install, sudo apt-get install.\n\nI have installed mysql in my virtual env. My directory structure is just the same as whats explained in the tutorial. The module is sucessfully installed in my system and still I am getting this error.\n\nPlease help. What could be causing this.","ecosystem":"pypi","package_name":"mysql","package_version":null,"solution":"If you're having issues compiling the binary extension, or on a platform where you can't, you can try using the pure Python PyMySQL bindings.\n\nSimply pip install pymysql and switch your SQLAlchemy URI to start like this:\n\nSQLALCHEMY_DATABASE_URI = 'mysql+pymysql://.....'\n\nThere are some other drivers you could also try.","confidence":0.95,"source":"stackoverflow","source_url":"https://stackoverflow.com/questions/22252397/importerror-no-module-named-mysqldb","votes":178,"created_at":"2026-04-19T04:41:39.773605+00:00","updated_at":"2026-04-19T04:52:00.971750+00:00"}