Skip to content

Step-by-step tutorial to connect Python to MySQL using XAMPP. Includes sample connection script, MySQL setup guide, and troubleshooting tips.

Notifications You must be signed in to change notification settings

data-geek-lab/connect-python-to-mysql-xampp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

connect-python-to-mysql-xampp

Step-by-step tutorial to connect Python to MySQL using XAMPP. Includes sample connection script, MySQL setup guide, and troubleshooting tips.

🔗 Connect Python to MySQL using XAMPP

This beginner-friendly project shows you how to connect Python to a MySQL database running locally through XAMPP. It's perfect for data analysts, students, and developers building real-time dashboards or data apps.


📁 Project Structure


✅ What You'll Learn

  • How to install and run MySQL using XAMPP
  • How to create a MySQL database using phpMyAdmin
  • How to connect Python to MySQL with mysql-connector-python
  • How to troubleshoot common connection issues

💻 Requirements

Make sure you have:

  • Python 3.x
  • XAMPP
  • mysql-connector-python (install with pip install mysql-connector-python)

🧪 How to Run

  1. Make sure MySQL is running in your XAMPP control panel
  2. Create a database in phpMyAdmin (e.g. sales_dashboard_mysql)
  3. Update your connection info in connect.py if needed
  4. Run the script:

Use this to run the code in your terminal: python connect.py

✅ Connected to MySQL successfully!

📺 Tutorial Video ▶️ Watch the full step-by-step video on YouTube: https://youtu.be/WnLWVwx9qY8?si=1OJVgcY6NDi-t5_x

⭐️ Like this project? Give it a ⭐️ and share with others who are learning Python + SQL!

☕Enjoying the Content? Support the channel here: https://buymeacoffee.com/datageekismyname in this beginner-friendly tutorial, I’ll show you how to connect Python to a MySQL database using XAMPP. This is a key step for building real-time dashboards, running data analysis, or creating full applications using your local database.

What You’ll Learn : • Install and run MySQL using XAMPP • Create a MySQL database using phpMyAdmin • Write a simple Python script to connect to MySQL

✅ Perfect for data analysts, developers, or students learning Python and SQL.

📦 Tools: Python, MySQL, XAMPP, mysql-connector-python

📺 Coming up next: Build a real-time dashboard using Streamlit + MySQL!

🔔 Don’t forget to LIKE & SUBSCRIBE for more Python & Data Analysis tutorials! Subscribe here: https://www.youtube.com/@datageekismyname

☕Enjoying the Content? Support the channel here: https://buymeacoffee.com/datageekismyname Or Link to donate on paypal: https://www.paypal.com/donate/?hosted_button_id=ZCL24X55R9C5G

About

Step-by-step tutorial to connect Python to MySQL using XAMPP. Includes sample connection script, MySQL setup guide, and troubleshooting tips.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages