-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.sql
More file actions
15 lines (13 loc) · 842 Bytes
/
init.sql
File metadata and controls
15 lines (13 loc) · 842 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
-- init.sql: Docker entrypoint initialization script for MySQL
-- Creates the data warehouse database if it doesn't exist
CREATE DATABASE IF NOT EXISTS `akshare_web` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE DATABASE IF NOT EXISTS `akshare_data` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- Grant permissions to the application user on both databases
-- (The MYSQL_USER from docker-compose already has access to MYSQL_DATABASE,
-- but we also need access to akshare_data for the data warehouse)
--
-- IMPORTANT (Production): Replace '%' with 'localhost' or specific IP to restrict remote access:
-- GRANT ALL PRIVILEGES ON `akshare_data`.* TO 'akshare_user'@'localhost';
-- Docker default uses '%' for cross-container connectivity.
GRANT ALL PRIVILEGES ON `akshare_data`.* TO 'akshare_user'@'%';
FLUSH PRIVILEGES;