initial commit
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
-- MySQL Database Setup for Bike Service Application
|
||||
-- Run this script as root user: mysql -u root -p < mysql-setup.sql
|
||||
|
||||
-- Create database
|
||||
CREATE DATABASE IF NOT EXISTS bikeservice_db
|
||||
CHARACTER SET utf8mb4
|
||||
COLLATE utf8mb4_unicode_ci;
|
||||
|
||||
-- Create user (replace 'your_secure_password' with a strong password)
|
||||
CREATE USER IF NOT EXISTS 'bikeservice_user'@'localhost'
|
||||
IDENTIFIED BY 'your_secure_password';
|
||||
|
||||
-- Grant privileges
|
||||
GRANT ALL PRIVILEGES ON bikeservice_db.* TO 'bikeservice_user'@'localhost';
|
||||
|
||||
-- Grant additional privileges for Laravel
|
||||
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES ON bikeservice_db.* TO 'bikeservice_user'@'localhost';
|
||||
|
||||
-- Flush privileges
|
||||
FLUSH PRIVILEGES;
|
||||
|
||||
-- Show created database and user
|
||||
SHOW DATABASES;
|
||||
SELECT User, Host FROM mysql.user WHERE User = 'bikeservice_user';
|
||||
|
||||
-- Display success message
|
||||
SELECT 'Database and user created successfully!' as Status;
|
||||
Reference in New Issue
Block a user