You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`--name hitide-mysql`: The name of the Docker container.
59
+
-`-e MYSQL_ROOT_PASSWORD=my-secret-pw`: The root password for MySQL.
60
+
-`-p 3306:3306`: The port mapping, which maps port 3306 on your host to port 3306 in the container.
61
+
62
+
#### Step 3: Verify the MySQL Container is Running
63
+
64
+
Check the status of the running container:
65
+
66
+
```bash
67
+
docker ps
68
+
```
69
+
70
+
You should see your MySQL container listed.
71
+
72
+
### 2. Creating the Database
73
+
74
+
#### Step 1: Connect to the MySQL Instance
75
+
76
+
Use your preferred MySQL client or the MySQL command-line tool to connect to the running MySQL instance:
77
+
78
+
```bash
79
+
mysql -h 127.0.0.1 -P 3306 -u root -p
80
+
```
81
+
82
+
You'll be prompted for the root password (my-secret-pw in this case).
83
+
84
+
#### Step 2: Create the Database
85
+
86
+
Once connected, create the database:
87
+
88
+
```sql
89
+
CREATEDATABASEhitide_profile;
90
+
```
91
+
92
+
### 3. Setting Up the Application
93
+
94
+
#### Step 1: Configure Environment Variables
95
+
96
+
Before running the setup script, configure the necessary environment variables. You can set these variables in your shell session or use a `.env` file. Here’s an example of how to set them:
97
+
98
+
```bash
99
+
export DATABASE_HOST=127.0.0.1
100
+
export DATABASE_PORT=3306
101
+
export DATABASE_NAME=hitide_profile
102
+
export DATABASE_ADMIN=root
103
+
export DATABASE_ADMIN_PASSWORD=my-secret-pw
104
+
export DATABASE_USERNAME=hitide_user
105
+
export DATABASE_PASSWORD=hitide_password
106
+
```
107
+
108
+
#### Step 2: Run the Setup Script
109
+
110
+
Navigate to the hitide-profile root directory and run the setup script:
111
+
112
+
```bash
113
+
cd path/to/hitide-profile
114
+
node mysql/setup-db.js
115
+
```
116
+
117
+
This script will:
118
+
- Connect to the MySQL instance using the admin credentials.
119
+
- Create a new user (specified by `DATABASE_USERNAME` and `DATABASE_PASSWORD`).
120
+
- Set up the necessary tables in the `hitide_profile` database.
121
+
122
+
### 4. Verifying the Setup
123
+
124
+
#### Step 1: Check Database and Tables
125
+
126
+
Reconnect to the MySQL instance and check the database and tables:
127
+
128
+
```bash
129
+
mysql -h 127.0.0.1 -P 3306 -u root -p
130
+
```
131
+
132
+
Then run:
133
+
134
+
```sql
135
+
USE hitide_profile;
136
+
SHOW TABLES;
137
+
```
138
+
139
+
You should see the tables created by the setup script.
140
+
141
+
### Note:
142
+
In HiTIDE UI code in the **hitideConfig.js** file, make sure you set the **hitideProfileOrigin** variable to where your local hitide-profile instance is running so the frontend knows where to find hitide-profile. For example:
143
+
```
144
+
var hitideProfileOrigin = "http://localhost:8080/hitide/api";
0 commit comments