-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Labels
bug/0-unknownBug is new, does not have information for reproduction or reproduction could not be confirmed.Bug is new, does not have information for reproduction or reproduction could not be confirmed.kind/bugA reported bug.A reported bug.topic: connection-url
Description
Bug description
The program does not parse correctly MySQL URL's when reserved characters are used (in password, for example).
When using a URL such as mysql://root:password_with_#@localhost:3306/mydb it outputs.
Introspecting based on datasource defined in prisma/schema.prisma …
Error: Error parsing connection string: invalid port number in `mysql://root:password_with_#@localhost:3306/mydb`)How to reproduce
- Create a user with a password with MySQL reserved characters (I only tested with #).
- Run
npx prisma introspectwith a database URL for this user.
It should output something as
Introspecting based on datasource defined in prisma/schema.prisma …
Error: Error parsing connection string: invalid port number in `mysql://root:password-with-#@localhost:3306/mydb`)I tried escaping the character with %, as specified by MySQL, and using quotation marks, but the error continued.
Expected behavior
The URL should be parsed correctly and the command run with success.
Prisma information
File schema.prisma
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "mysql"
url = env("DATABASE_URL")
}Environment & setup
- OS: Fedora 32
- Database: MySQL
- Node.js version: v12.18.3
- Prisma version: 2.8.1
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bug/0-unknownBug is new, does not have information for reproduction or reproduction could not be confirmed.Bug is new, does not have information for reproduction or reproduction could not be confirmed.kind/bugA reported bug.A reported bug.topic: connection-url