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.

Mariasql fails with 'no database selected'

See original GitHub issue

Fixed by setting db instead of database:

config = {
  client: 'mariasql',
  connection: {
    db: 'yourdb',
    user: 'your_user',
    host: 'your_host',
    password: 'your_pass'
  }
};

Issue Analytics

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

github_iconTop GitHub Comments

7reactions
lmj0011commented, Apr 21, 2017

Fixed by setting db instead of database:

This is the most ridiculous s#@t ever!

I spent 3 hours looking around for this solution

nicmoji_the_bees

rgcpkeu

steve_disappointed

I suppose I should let the guys at adonis.js know to update their mariadb config example: http://adonisjs.com/docs/3.2/database-setup#_mariadb

before someone else’s head explodes

1reaction
majimboocommented, May 4, 2016

Hello, I too am getting this error with mariasql (latest). 2 years later and still no alias for the property with mariasql ^_^

Unhandled rejection Error: select users.* from users - No database selected at Error (native)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error 1046 No database Selected, how to resolve?
Error 1046 occurs when we miss to connect our table with a database. In this case, we don't have any database and that's...
Read more >
Error 1046 Mariadb: No database selected
Ok, I have created a database with a "-" on the name (did the same thing on the user)... then when I try...
Read more >
MySQL Error - #1046 - No database selected - Tutorialspoint
MySQL Error - #1046 - No database selected - The error-#1046 can occur when we are creating a table, but forget to select...
Read more >
[MDEV-26469] "No database selected" error reported even if a ...
When executing a Delete request with a CTE, the request fails with "No database selected" error. Below a script that reproduce the issue: ......
Read more >
Selecting a MariaDB Database
In this tutorial, you will learn how to select a MariaDB database as the current database. ... ERROR 1046 (3D000): No database selected....
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