π§± STEP 1: Install & start MySQL (Ubuntu side)
sudo apt update
sudo apt install mysql-server -y
Verify itβs running:
sudo systemctl status mysql
If needed:
sudo systemctl enable mysql
sudo systemctl start mysql
π STEP 2: Secure MySQL (recommended)
sudo mysql_secure_installation
Use:
- Password validation: Yes
- Strength: Medium
- Remove anonymous users: Yes
- Disallow root remote login: Yes
- Remove test DB: Yes
- Reload privileges: Yes
π§βπ» STEP 3: Log in as MySQL root (Ubuntu socket auth)
sudo mysql
You should see:
mysql>
ποΈ STEP 4: Create the Pulse database
CREATE DATABASE pulse
CHARACTER SET utf8mb4
COLLATE utf8mb4_unicode_ci;
Verify:
SHOW DATABASES;
π€ STEP 5: Create a Pulse DB user (IMPORTANT)
Do not use root for apps.
CREATE USER 'pulse'@'localhost'
IDENTIFIED BY 'StrongPasswordHere';
Grant rights:
GRANT ALL PRIVILEGES ON pulse.* TO 'pulse'@'localhost';
FLUSH PRIVILEGES;
Exit:
EXIT;
π§ͺ STEP 6: Test the Pulse user
mysql -u pulse -p pulse
If you see:
mysql>
β User + DB are working.
𧬠STEP 7: Create the schema (TWO OPTIONS)
β OPTION A (RECOMMENDED): Let EF Core create tables
From your Pulse.Api or Pulse.Data project on Ubuntu:
Install EF tools (once)
dotnet tool install --global dotnet-ef
Ensure path:
export PATH="$PATH:$HOME/.dotnet/tools"
Run migrations
dotnet ef migrations add InitialPulseSchema
dotnet ef database update
π EF will now create all Pulse tables in MySQL.
βοΈ OPTION B: Manual SQL schema (no EF)
If youβre not ready for EF migrations yet:
mysql -u pulse -p pulse
Paste the schema SQL I gave earlier:
-- nodes
CREATE TABLE nodes ( ... );
-- agent_heartbeats
CREATE TABLE agent_heartbeats ( ... );
-- etc
Exit when done.
π STEP 8: Configure Pulse connection string (CRITICAL)
appsettings.json
{
"ConnectionStrings": {
"PulseDb": "Server=localhost;Port=3306;Database=pulse;User=pulse;Password=StrongPasswordHere;SslMode=Preferred;"
}
}
π STEP 9: Verify tables exist
mysql -u pulse -p pulse
SHOW TABLES;
You should see:
nodes
agent_heartbeats
network_interfaces
services
service_status
metrics
alerts
api_keys
π§ STEP 10: Common Ubuntu/MySQL gotchas (read this)
β Canβt connect?
sudo systemctl restart mysql
β EF migration fails?
Make sure Pomelo is installed:
dotnet add package Pomelo.EntityFrameworkCore.MySql
β Remote agents later?
Edit:
sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf
Set:
bind-address = 0.0.0.0
Then:
sudo systemctl restart mysql sudo ufw allow 3306
πΎ Populate tables in the database.
Run:
dotnet pulse.Api --migrate
dotnet pulse.Web --migrate-auth
If Pulse starts without DB errors, youβre done.