Overview
Kin Conecta uses MySQL 8+ as its relational database. This guide covers the complete setup process, from installing MySQL to running the schema and seeding initial data.Prerequisites
- MySQL Server 8.0 or higher
- MySQL Workbench (optional but recommended)
- Access to MySQL root user or a user with schema creation privileges
Installation
Install MySQL Server
Download and install MySQL Server from the official MySQL website.During installation, set a secure root password and note it down for later configuration.
Verify MySQL Installation
Open a terminal or command prompt and verify MySQL is running:You should see output similar to:
mysql Ver 8.0.xCreate the Database Schema
Navigate to the backend directory and locate the SQL schema file:The main schema file is
kinConnect.sql. This script will create the KCv2 schema with all required tables.Execute the Schema Script
Run the SQL script using MySQL Workbench or command line:The script creates the schema
KCv2 with UTF-8MB4 Unicode collation.Database Schema
The Kin Conecta database includes the following main tables:Core Tables
- languages - Supported languages (es, en, fr)
- users - User accounts (TOURIST, GUIDE, ADMIN roles)
- tourist_profiles - Tourist profile information
- guide_profiles - Guide profile information and ratings
- interests - Available interest categories
- guide_expertise_areas - Guide specialization areas
Tour & Booking Tables
- tours - Tour offerings created by guides
- tour_categories - Tour categorization (Gastronómico, Aventura, Cultural)
- destinations - Cities and locations
- trip_bookings - Booking records linking tourists, guides, and tours
- trip_status_history - Audit trail for booking status changes
Interaction Tables
- reviews - Tourist reviews for completed trips
- review_replies - Guide responses to reviews
- chat_threads - Conversation threads between users
- chat_messages - Individual chat messages
- favorite_guides - Tourist saved guides
- favorite_tours - Tourist saved tours
Support Tables
- support_tickets - Customer support requests
- faq_categories - FAQ organization
- faq_items - Frequently asked questions
- contact_messages - Contact form submissions
System Tables
- auth_sessions - User authentication sessions
- notifications - User notifications
- guide_calendar_events - Guide availability and bookings
- compatibility_profiles - Matching algorithm profiles
- compatibility_answers - User answers for matching
Schema Configuration
Default Schema Name
ThekinConnect.sql script contains:
Schema Name Mismatch
If you need to use a different schema name:- Edit the SQL script and change
KCv2to your preferred name - Update the
spring.datasource.urlinapplication.propertiesto match - Re-run the schema creation script
Verifying the Setup
Common Issues
Unknown Database Error
If you seeUnknown database 'KCv2' when starting the application:
- Verify the schema exists in MySQL
- Check the schema name matches in both the SQL script and
application.properties - Ensure you executed the
kinConnect.sqlscript successfully
Authentication Failed
If MySQL connection fails with authentication errors:- Verify your MySQL username and password in
application.properties - Test the connection manually:
- Check if the MySQL user has sufficient privileges
Character Encoding Issues
The schema usesutf8mb4 encoding for full Unicode support (including emojis). If you encounter encoding issues:
- Verify MySQL server configuration supports utf8mb4
- Check the connection URL includes charset parameters
- Ensure client tools (MySQL Workbench) use UTF-8 encoding
Next Steps
Once the database is set up, proceed to:- Configuration - Configure database connection settings
- Backend Deployment - Start the Spring Boot backend