# How can we see mysql query

**URL:** <https://www.ruby-forum.com/t/how-can-we-see-mysql-query/136720>\
**Category:** Rails\
**Created:** [May 5, 2008, 9:44pm UTC](https://www.ruby-forum.com/t/how-can-we-see-mysql-query/136720 "2008-05-05T21:44:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![manish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a6a055/32.png) [@manish](https://www.ruby-forum.com/u/manish)\
**Post date:** [May 5, 2008, 9:44pm UTC](https://www.ruby-forum.com/t/how-can-we-see-mysql-query/136720/1 "2008-05-05T21:44:02Z")

</div>

HI I m new to ROR…  
I m a PHP developer…my query is  
like in php when we have to see mysql query we just echo it to see it.  
Is there any function - method is in ROR to see what the query is  
running rite now.

---

<div class="post-metadata">

**Author:** ![manish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a6a055/32.png) [@manish](https://www.ruby-forum.com/u/manish)\
**Post date:** [May 5, 2008, 9:51pm UTC](https://www.ruby-forum.com/t/how-can-we-see-mysql-query/136720/2 "2008-05-05T21:51:13Z")

</div>

Manish N. wrote:

> HI I m new to ROR…  
> I m a PHP developer…my query is  
> like in php when we have to see mysql query we just echo it to see it.  
> Is there any function - method is in ROR to see what the query is  
> running rite now.

You can look in the development.log in the log folder.

Peace,  
Phillip

---

<div class="post-metadata">

**Author:** ![manish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a6a055/32.png) [@manish](https://www.ruby-forum.com/u/manish)\
**Post date:** [May 6, 2008, 3:04am UTC](https://www.ruby-forum.com/t/how-can-we-see-mysql-query/136720/3 "2008-05-06T03:04:55Z")

</div>

You might find it helpful to have the following 4 console windows open  
in your dev environment:

> mongrel\_rails start; if you are using rails  
> this is where your code will show the debugger if you type debugger  
> anywhere in the code

> cd log; tail -f development.log  
> to see the log of all the activity as you hit the browser as you code.  
> This is where the SQL queries will show up as well as any warnings,  
> code as it is evaluated, etc.

> script/console  
> you want to have the script/console open so that you can easily test  
> expressions, etc.

> path to your app  
> so that you can run the migrations, rake tasks.
