Python, Flask, MYSQL - Basics - Demo
Here's a step-by-step guide to set up MySQL using XAMPP , create a database, and run your Flask + SQLAlchemy app using the .env -based setup. ✅ Step 1: Install and Run XAMPP Download XAMPP from https://www.apachefriends.org/index.html . Install XAMPP on your system. Open the XAMPP Control Panel . Start Apache and MySQL modules. Green indicators mean they are running. ✅ Step 2: Open phpMyAdmin & Create Database Go to your browser and open: http://localhost/phpmyadmin Click on Databases tab. In the "Create database" field, type: phd (or your DB name). Click Create . Done! Your MySQL DB is ready. ✅ Step 3: Create .env File in Flask Project In your Flask project directory, create a file named .env : DB_USERNAME=root DB_PASSWORD= DB_HOST=localhost DB_PORT=3306 DB_NAME=phd XAMPP default MySQL username is root Password is usually empty (set it in phpMyAdmin if you want) ✅ Step 4: Install Required Python Package...