# Newbie problem - unexpected MySQL error

**URL:** <https://www.ruby-forum.com/t/newbie-problem-unexpected-mysql-error/50458>\
**Category:** Rails\
**Created:** [December 16, 2005, 4:11pm UTC](https://www.ruby-forum.com/t/newbie-problem-unexpected-mysql-error/50458 "2005-12-16T16:11:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mumin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9f8e36/32.png) [@Mumin](https://www.ruby-forum.com/u/Mumin)\
**Post date:** [December 16, 2005, 4:11pm UTC](https://www.ruby-forum.com/t/newbie-problem-unexpected-mysql-error/50458/1 "2005-12-16T16:11:15Z")

</div>

Hi,

I get this, when I try to load a view entry page:  
Mysql::Error: Lost connection to MySQL server during query: SELECT \*  
FROM locations WHERE (locations.id = 8) LIMIT 1

When I run the query in an sql client it works perfectly (returning a  
row).

Now, I know it does connect to the database, because it prints another  
error when I set the database port to a wrong value. The error occurs  
inside the log function of the abstract controller.

Any idea what might be causing it? Or even better, how I should debug it  
myself?

Thanks 🙂

---

<div class="post-metadata">

**Author:** ![Mumin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9f8e36/32.png) [@Mumin](https://www.ruby-forum.com/u/Mumin)\
**Post date:** [December 20, 2005, 1:18pm UTC](https://www.ruby-forum.com/t/newbie-problem-unexpected-mysql-error/50458/2 "2005-12-20T13:18:11Z")

</div>

Try this:

[Peak Obsession](http://wiki.rubyonrails.com/rails/pages/Mysql+Connection+Problems/)
