19 lines
841 B
SQL
19 lines
841 B
SQL
-- Run this as MySQL root user to create the database user and grant permissions
|
|
|
|
-- Create the database if it doesn't exist
|
|
CREATE DATABASE IF NOT EXISTS emergency_tracker CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
|
|
|
-- Create the user (replace 'your_password' with a strong password)
|
|
CREATE USER IF NOT EXISTS 'soldier_tracker'@'localhost' IDENTIFIED BY 'your_secure_password_here';
|
|
CREATE USER IF NOT EXISTS 'soldier_tracker'@'%' IDENTIFIED BY 'your_secure_password_here';
|
|
|
|
-- Grant all privileges on the emergency_tracker database
|
|
GRANT ALL PRIVILEGES ON emergency_tracker.* TO 'soldier_tracker'@'localhost';
|
|
GRANT ALL PRIVILEGES ON emergency_tracker.* TO 'soldier_tracker'@'%';
|
|
|
|
-- Flush privileges to apply changes
|
|
FLUSH PRIVILEGES;
|
|
|
|
-- Show the user was created
|
|
SELECT User, Host FROM mysql.user WHERE User = 'soldier_tracker';
|