@alucardu 👋
Why doesn't your Postgres URL have a password? It's probably why Prisma can't connect. I can successfully connect my local Docker setup with Prisma and my URL looks something like this:
DB_URL="postgresql://postgres:password@localhost:5432/database"
docker - Prisma cannot authenticate database server - Stack Overflow
Authentication failed against database server at `ip external`, the provided database credentials for `user` are not valid.
Authentication failed against database server at `localhost`, the provided database credentials for `root` are not valid - Nextjs & Prisma
'Yarn Prisma Migrate Dev' fails with Error: P1000 stating the credentials provided are not valid. These credentials work on all other machines
What-a-mistaka-to-make. I had postgres installed locally on my Windows machine. So it was using that instance of postgres instead of the one on my docker environment. I removed the windows postgres installation and everything is working as expected. https://github.com/prisma/prisma/issues/8927
If you are still having this problem, check if you have postgres installed on the machine without docker and check if postgres is started on Windows and stop this process and try again
enter image description here
in my local environment, i create a new database user, and set a simple password,then, it's ok.
DATABASE_URL="mysql://local:root123@localhost:3306/clever"
If your password contains special characters like @, $ and &. Use url encoded version.
@becomes%40$becomes%24&becomes%26
replace with above characters. It should work
Sorry if this is the wrong subreddit for this, please let me know where else I can post to for this issue.
Whenever I run the command 'yarn prisma migrate dev --preview-feature' or just 'yarn prisma migrate dev' I receive:
"Error: P1000: Authentication failed against database server at localhost
, the provided database credentials for dbusername
are not valid."
The exact same setup and credentials on all other machines work so I know it doesn't have to do with the credentials. This is using a PostgreSQL database on docker, with the prisma seed and schema in VScode.
It possibly that the credentials are not actually being checked since I don't see any failed attempts show up in the log on the docker side of things. Any ideas on how to resolve this or that I need to provide more info?
I've managed to make Prisma work with SQL Server with the free developer license on localhost following the steps shown in 2 places on the prisma documentation:
To build the DATABASE_URL string just follow this pattern:
// The schema is optional
DATABASE_URL=sqlserver://${MSSQL_HOST}:${MSSQL_PORT};database=${MSSQL_DATABASE};user=${MSSQL_USER};password=${MSSQL_PASSWORD};schema=${MSSQL_SCHEMA};trustServerCertificate=true;encrypt=true
Then set this options in the "SQL Server Configuration Manager"
1 Enable TCP/IP
Prisma Client requires TCP/IP to be enabled. To enable TCP/IP:
Open SQL Server Configuration Manager. (Search for "SQL Server Configuration Manager" in the Start Menu, or open the Start Menu and type "SQL Server Configuration Manager".)
In the left-hand panel, click SQL Server Network Configuration > Protocols for MSSQLSERVER
Right-click TCP/IP and choose Enable.
2 Enable authentication with SQL logins
If you want to use a username and password in your connection URL rather than integrated security, enable mixed authentication mode as follows:
Right-click on your database engine in the Object Explorer and click Properties.
In the Server Properties window, click Security in the left-hand list and tick the SQL Server and Windows Authentication Mode option, then click OK.
Right-click on your database engine in the Object Explorer and click Restart.
3. (Optional) Enable the sa login
To enable the default sa (administrator) SQL Server login:
In SQL Server Management Studio, in the Object Explorer, expand Security > Logins and double-click sa.
On the General page, choose a password for the sa account (untick Enforce password policy if you do not want to enforce a policy).
On the Status page, under Settings > Login, tick Enabled, then click OK.
You can now use the sa account in a connection URL and when you log in to SQL Server Management Studio.
You can jsut add integratedSecurity=true;trustServerCertificate=true; to the connection string.
An Example connection string will be:
sqlserver://DB_HOST:DB_PORT;database=DB_NAME;integratedSecurity=true;trustServerCertificate=true;
After trying almost everything, I thought to start over and surprisingly after removing all my containers and creating new ones resolved the problem.
Here are the commands for stopping running containers:
docker stop $(docker ps -aq)
For removing all containers:
docker rm $(docker ps -aq)
docker rmi $(docker images -q) # Optionally, remove all images
docker network prune # Remove all unused networks
Are you sure you're connecting to the correct postgres instance?
What if you try changing the connection-url to:
DATABASE_URL="postgresql://postgres:passcode@parkngo_db:2010/postgres?schema=public"