-- Create the database
CREATE DATABASE IF NOT EXISTS ruralpoint_system CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- Create the user if it doesn't exist
CREATE USER IF NOT EXISTS 'phinrural'@'localhost' IDENTIFIED BY '5;)8.H8aTG8%p_]';

-- Grant privileges to the user
GRANT ALL PRIVILEGES ON ruralpoint_system.* TO 'phinrural'@'localhost';

-- Flush privileges to apply changes
FLUSH PRIVILEGES;