help a noob, Error P1017

Help a noob, npm run db:push / bun run db:push does this
No description
12 Replies
Styly
Styly9mo ago
check your db there is an issue, because P1017 means prisma could not connect to the db are you hosting a local db else it shouldn't be localhost
Nas-damha
Nas-damhaOP9mo ago
I'm using the ./start-database.sh docker mysql setup can someone help?
Styly
Styly9mo ago
this is RTFM
Nas-damha
Nas-damhaOP9mo ago
huh?
Styly
Styly9mo ago
i dont know whats your os, the script if you configured your config for db. a
Nas-damha
Nas-damhaOP9mo ago
I use wsl
Styly
Styly9mo ago
the script?
Nas-damha
Nas-damhaOP9mo ago
its default config, from bun create t3app command i only change the container name from .-mysql to mysql cause .-mysql "arent a valid container name"
Styly
Styly9mo ago
i cannot find it in repo nvm can you share the script?
Nas-damha
Nas-damhaOP9mo ago
This one uses postgres
#!/bin/bash
# Use this script to start a docker container for a local development database

# TO RUN ON WINDOWS:
# 1. Install WSL (Windows Subsystem for Linux) - https://learn.microsoft.com/en-us/windows/wsl/install
# 2. Install Docker Desktop for Windows - https://docs.docker.com/docker-for-windows/install/
# 3. Open WSL - `wsl`
# 4. Run this script - `./start-database.sh`

# On Linux and macOS you can run this script directly - `./start-database.sh`

DB_CONTAINER_NAME=".-postgres"

if ! [ -x "$(command -v docker)" ]; then
echo "Docker is not installed. Please install docker and try again.\nDocker install guide: https://docs.docker.com/engine/install/"
exit 1
fi

if [ "$(docker ps -q -f name=$DB_CONTAINER_NAME)" ]; then
docker start $DB_CONTAINER_NAME
echo "Database container started"
exit 0
fi

# import env variables from .env
set -a
source .env

DB_PASSWORD=$(echo $DATABASE_URL | awk -F':' '{print $3}' | awk -F'@' '{print $1}')

if [ "$DB_PASSWORD" = "password" ]; then
echo "You are using the default database password"
read -p "Should we generate a random password for you? [y/N]: " -r REPLY
if ! [[ $REPLY =~ ^[Yy]$ ]]; then
echo "Please set a password in the .env file and try again"
exit 1
fi
DB_PASSWORD=$(openssl rand -base64 12)
sed -i -e "s#:password@#:$DB_PASSWORD@#" .env
fi

docker run --name $DB_CONTAINER_NAME -e POSTGRES_PASSWORD=$DB_PASSWORD -e POSTGRES_DB=. -d -p 5432:5432 docker.io/postgres

echo "Database container was succesfuly created"
#!/bin/bash
# Use this script to start a docker container for a local development database

# TO RUN ON WINDOWS:
# 1. Install WSL (Windows Subsystem for Linux) - https://learn.microsoft.com/en-us/windows/wsl/install
# 2. Install Docker Desktop for Windows - https://docs.docker.com/docker-for-windows/install/
# 3. Open WSL - `wsl`
# 4. Run this script - `./start-database.sh`

# On Linux and macOS you can run this script directly - `./start-database.sh`

DB_CONTAINER_NAME=".-postgres"

if ! [ -x "$(command -v docker)" ]; then
echo "Docker is not installed. Please install docker and try again.\nDocker install guide: https://docs.docker.com/engine/install/"
exit 1
fi

if [ "$(docker ps -q -f name=$DB_CONTAINER_NAME)" ]; then
docker start $DB_CONTAINER_NAME
echo "Database container started"
exit 0
fi

# import env variables from .env
set -a
source .env

DB_PASSWORD=$(echo $DATABASE_URL | awk -F':' '{print $3}' | awk -F'@' '{print $1}')

if [ "$DB_PASSWORD" = "password" ]; then
echo "You are using the default database password"
read -p "Should we generate a random password for you? [y/N]: " -r REPLY
if ! [[ $REPLY =~ ^[Yy]$ ]]; then
echo "Please set a password in the .env file and try again"
exit 1
fi
DB_PASSWORD=$(openssl rand -base64 12)
sed -i -e "s#:password@#:$DB_PASSWORD@#" .env
fi

docker run --name $DB_CONTAINER_NAME -e POSTGRES_PASSWORD=$DB_PASSWORD -e POSTGRES_DB=. -d -p 5432:5432 docker.io/postgres

echo "Database container was succesfuly created"
Styly
Styly9mo ago
you broke it
Nas-damha
Nas-damhaOP9mo ago
how? it's default
Want results from more Discord servers?
Add your server