question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[mysql] Database name isn't read from url

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:9
  • Comments:15 (5 by maintainers)

github_iconTop GitHub Comments

12reactions
vfaskycommented, Dec 31, 2019

Still not fixed in v0.2.22

10reactions
AndKielcommented, Feb 12, 2019

I think it’s not fixed, happening to me on v0.2.13.

Read more comments on GitHub >

github_iconTop Results From Across the Web

B.3.2.2 Can't connect to [local] MySQL server
A MySQL client on Unix can connect to the mysqld server in two different ways: By using a Unix socket file to connect...
Read more >
Get the connected mysql database name (JDBC)
Probably the most straightforward way to get the database name from the JDBC Connection object itself is via the getCatalog() method:.
Read more >
Troubleshooting your MySQL database
Initialize mysqli first via mysqli_init, and use mysqli_options() to specify local infile as true before connecting to the mysql server: $link = ...
Read more >
How To Fix The "Error Establishing a Database Connection" in ...
<?php $test = mysqli_connect('localhost', 'db_user', 'db_password'); if (!$test) { die('MySQL Error: ' . mysqli_error() ...
Read more >
How to Connect to the MySQL Database | HostGator Support
What are my database configuration settings? · The database name and username may change when moving databases to our servers. · On Shared...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found