Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQLAlchemy connection issue ('ModuleNotFoundError: No module named 'MySQLdb'') #5714

Closed
TuAgT opened this issue May 16, 2024 · 2 comments
Closed

Comments

@TuAgT
Copy link

TuAgT commented May 16, 2024

Describe the bug

SQLAlchemy connection issue ('ModuleNotFoundError: No module named 'MySQLdb'')
To Reproduce

  1. pipx install sqlmap
  2. sqlmap -d "mysql+pymysql://root:root@127.0.0.1:3306/information_schema"
image
  1. pipx runpip sqlmap install PyMySQL
  2. sqlmap -d "mysql+pymysql://root:root@127.0.0.1:3306/information_schema"
image 5. pipx runpip sqlmap install SQLAlchemy 6. sqlmap -d "mysql://root:root@127.0.0.1:3306/information_schema" image

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Running environment:

  • sqlmap version 1.8.5
  • Installation method pipx install sqlmap
  • Operating system: macOS Sonoma 14.4.1
  • Python version 3.12

Target details:

  • DBMS mysql5.5

Additional context

[!] legal disclaimer: Usage of sqlmap for attacking targets without prior mutual consent is illegal. It is the end user's responsibility to obey all applicable local, state and federal laws. Developers assume no liability and are not responsible for any misuse or damage caused by this program

[*] starting @ 23:03:02 /2024-05-16/

[23:03:03] [CRITICAL] SQLAlchemy connection issue ('ModuleNotFoundError: No module named 'MySQLdb'')

[*] ending @ 23:03:03 /2024-05-16/

docker-compose.yml

services:
  db:
    image: mysql:5.5
    platform: linux/amd64
    environment:
      - MYSQL_ROOT_PASSWORD=root
    ports:
      - "3306:3306"
@stamparm
Copy link
Member

image
image

@stamparm
Copy link
Member

so, created everything from scratch. please, forgive me to not put links to letmegooglethatforyou in sqlmap output, especially in your case

so, TL;DR, this worked:

docker-compose up

virtualenv testsql
source testsql/bin/activate
python -m pip install sqlalchemy
python sqlmap.py -d "mysql://root:root@127.0.0.1:3306/information_schema"
python -m pip install pymysql
python sqlmap.py -d "mysql://root:root@127.0.0.1:3306/information_schema"

now, step by step, with some pictures:

image

literary first Google result shows this:

image

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants