-- Fix MySQL user for Grazuri
-- Drop and recreate the user to ensure clean setup

DROP USER IF EXISTS 'xygbfpsg_graz'@'localhost';


-- Create database if it doesn't exist
CREATE DATABASE IF NOT EXISTS xygbfpsg_loans CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- Grant all privileges
GRANT ALL PRIVILEGES ON xygbfpsg_loans.* TO 'xygbfpsg_graz'@'localhost';
FLUSH PRIVILEGES;

-- Show the user was created
SELECT user, host FROM mysql.user WHERE user = 'xygbfpsg_graz';
