Prisma P1001 Error Only on One MySQL DB (Same VPS, Sequelize Works)
Hey everyone, I’m running into a weird Prisma issue and could use some help.
I have two MySQL databases hosted on the same VPS, but on different ports:
* ✅
test
DB on 106.129.20.246:3354
(works fine with Prisma)
* ❌ db
DB on 106.129.20.246:3306
(fails with Prisma)
I can connect to both using Sequelize without any issues, but Prisma fails on the second one with this error:
Even though the MySQL server is running fine, and Sequelize confirms the connection.
Here’s the env for the failing one:
I've already:
* Opened port 3306 in the firewall
* Set bind-address = 0.0.0.0
in mysqld.cnf
* Verified Prisma works fine on port 3354 (Dokploy-managed MySQL)
💭 Why would Prisma fail but Sequelize work? Does Prisma do something special (like shadow DB or connection pool check) that could fail silently?
Thanks in advance!
Let me know if you want to add logs, schema snippets, or your .env
config as well.4 Replies
Skipping coffee for instant knowledge! Let's brew that AI answer now.
Based on the knowledge sources, this issue appears similar to several reported cases where Prisma can't connect to a MySQL/MariaDB database despite other tools working fine.
Several possible causes for your P1001 error:
1. SSL Certificate Issues: If your connection requires SSL, the certificate path might be incorrect or inaccessible. One user solved a similar issue by changing the certificate path in their connection string from
/etc/pki/tls/certs/ca-bundle.crt
to /etc/ssl/certs/ca-certificates.crt
in this GitHub issue.
2. VPN Interference: One user reported that running a VPN in the background caused connection issues with Prisma while other tools worked fine as mentioned here.
3. Connection String Format: Double-check your connection string format. A user mistakenly used :
instead of @
between password and host in this issue.
4. MySQL Configuration: Your MySQL server might have specific settings that block Prisma's connection method. One user solved their issue by setting skip_networking=0
in their MySQL configuration as noted here.
5. Firewall/Security Rules: Despite opening port 3306, there might be application-level security rules affecting only Prisma connections.
Try these troubleshooting steps:
- Add connection parameters like ?connect_timeout=300
to your connection string
- Check if MySQL logs show any rejected connection attempts
- Try connecting with 127.0.0.1
instead of the IP if testing locally
- Verify user permissions are identical for both databases
If you're still stuck, enable Prisma debug logs with DEBUG="*" npx prisma db pull
to get more detailed error information.Hi!
Did any of the AI recommendations helped?
sry but why you use 2 MySQL Servers on one Host? Why not 2 Databases on one MySQL Server?
i hosted second one for testing but the issue was coming before too
but second one was working fine and that was deployed on dokploy
and now its working like prisma pull cmd is working but only migrate was not working