# Queries Are Not Executing

**URL:** <https://forum.codewithmosh.com/t/queries-are-not-executing/10941>\
**Category:** SQL\
**Created:** [February 26, 2022, 12:35am UTC](https://forum.codewithmosh.com/t/queries-are-not-executing/10941 "2022-02-26T00:35:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lierre](https://avatars.discourse-cdn.com/v4/letter/l/c89c15/32.png) [@lierre](https://forum.codewithmosh.com/u/lierre)\
**Post date:** [February 26, 2022, 12:35am UTC](https://forum.codewithmosh.com/t/queries-are-not-executing/10941/1 "2022-02-26T00:35:05Z")

</div>

The execution of every query produces the response:  
Error 1046: No DB selected.  
How do I correct this?

---

<div class="post-metadata">

**Author:** ![BFX0.9](https://avatars.discourse-cdn.com/v4/letter/b/c6cbf5/32.png) [@BFX0.9](https://forum.codewithmosh.com/u/BFX0.9)\
**Post date:** [February 26, 2022, 7:30am UTC](https://forum.codewithmosh.com/t/queries-are-not-executing/10941/2 "2022-02-26T07:30:22Z")

</div>

You can Execute “USE database\_name” to select the database you want to query.  
Or if you’re on mysql workbench you can double-click on the database you want to query to select it.
