Skip to content

[mysql] Database name isn't read from url #2096

@jcudzich

Description

@jcudzich

Issue type:

[x] question

Database system/driver:

[x] mysql / mariadb

TypeORM version:

[x] latest

Question:

Hello,

I use mysql url connection string, but I get error:

Option "database" is not set in your connection options, please define "database" option in your connection options or ormconfig.json

When i add database property to connection options everything is fine, but why database name can't be read from url? My url:

mysql://username:password@host:port/database

I think that database should be reads from url when it's defined.
What do you think?

Update:
I'm not sure, but I think is bug, becouse when I debug connection I see that database name i corectly read from url, but error is throw by EntityMetadataValidator which not found database options in EntityMetadata.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions