-- =============================================
-- 资金服务平台 - 数据库用户授权脚本
-- User: fundsp
-- Version: 1.0
-- Created: 2026-02-22
-- 注意：此脚本必须在所有数据库创建后执行
-- =============================================

-- 授予所有数据库权限
GRANT ALL PRIVILEGES ON fund_sys.* TO 'fundsp'@'%';
GRANT ALL PRIVILEGES ON fund_sys.* TO 'fundsp'@'localhost';
GRANT ALL PRIVILEGES ON fund_cust.* TO 'fundsp'@'%';
GRANT ALL PRIVILEGES ON fund_cust.* TO 'fundsp'@'localhost';
GRANT ALL PRIVILEGES ON fund_proj.* TO 'fundsp'@'%';
GRANT ALL PRIVILEGES ON fund_proj.* TO 'fundsp'@'localhost';
GRANT ALL PRIVILEGES ON fund_req.* TO 'fundsp'@'%';
GRANT ALL PRIVILEGES ON fund_req.* TO 'fundsp'@'localhost';
GRANT ALL PRIVILEGES ON fund_exp.* TO 'fundsp'@'%';
GRANT ALL PRIVILEGES ON fund_exp.* TO 'fundsp'@'localhost';
GRANT ALL PRIVILEGES ON fund_receipt.* TO 'fundsp'@'%';
GRANT ALL PRIVILEGES ON fund_receipt.* TO 'fundsp'@'localhost';
GRANT ALL PRIVILEGES ON fund_file.* TO 'fundsp'@'%';
GRANT ALL PRIVILEGES ON fund_file.* TO 'fundsp'@'localhost';

-- 刷新权限
FLUSH PRIVILEGES;

-- 显示授权结果
SHOW GRANTS FOR 'fundsp'@'%';
SHOW GRANTS FOR 'fundsp'@'localhost';

-- =============================================
-- 脚本执行完成
-- =============================================
