# MySQL - Lost Connection?

**URL:** <https://www.ruby-forum.com/t/mysql-lost-connection/79696>\
**Category:** Rails\
**Created:** [December 18, 2006, 10:58am UTC](https://www.ruby-forum.com/t/mysql-lost-connection/79696 "2006-12-18T10:58:05Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![aliasxneo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/df705f/32.png) [@aliasxneo](https://www.ruby-forum.com/u/aliasxneo)\
**Post date:** [December 18, 2006, 10:58am UTC](https://www.ruby-forum.com/t/mysql-lost-connection/79696/1 "2006-12-18T10:58:05Z")

</div>

I have no idea why I am getting this error. I have checked my database  
thoroughly and have found nothing wrong with it. I’m running MySQL 5.0,  
here is the exact error I am getting:

Mysql::Error: Lost connection to MySQL server during query: SELECT \*  
FROM composers

Does anybody know how to fix this? Thanks.

Cheers,

- Josh

---

<div class="post-metadata">

**Author:** ![aliasxneo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/df705f/32.png) [@aliasxneo](https://www.ruby-forum.com/u/aliasxneo)\
**Post date:** [December 18, 2006, 11:52am UTC](https://www.ruby-forum.com/t/mysql-lost-connection/79696/2 "2006-12-18T11:52:52Z")

</div>

AliasX Neo wrote:

> I have no idea why I am getting this error. I have checked my database  
> thoroughly and have found nothing wrong with it. I’m running MySQL 5.0,  
> here is the exact error I am getting:
> 
> Mysql::Error: Lost connection to MySQL server during query: SELECT \*  
> FROM composers
> 
> Does anybody know how to fix this? Thanks.

I had to swap my MySQL driver for that error to go away. I got that  
error while using the pure ruby driver, but with libmysql-ruby1.8 from  
Ubuntu/Debian it worked again.

–  
Erlend S.

> **[Clocking IT](http://www.clockingit.com)**
>
> Clocking IT - Keeping track of things so you can work

---

<div class="post-metadata">

**Author:** ![aliasxneo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/df705f/32.png) [@aliasxneo](https://www.ruby-forum.com/u/aliasxneo)\
**Post date:** [December 18, 2006, 12:24pm UTC](https://www.ruby-forum.com/t/mysql-lost-connection/79696/3 "2006-12-18T12:24:03Z")

</div>

Which operating system are you running on?

- Roderick

---

<div class="post-metadata">

**Author:** ![aliasxneo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/df705f/32.png) [@aliasxneo](https://www.ruby-forum.com/u/aliasxneo)\
**Post date:** [December 18, 2006, 6:04pm UTC](https://www.ruby-forum.com/t/mysql-lost-connection/79696/4 "2006-12-18T18:04:56Z")

</div>

Roderick van Domburg wrote:

> Which operating system are you running on?
> 
> - Roderick

I’m running on Windows XP Pro with MySQL 5.0. Where can I find an  
alternative for Windows?

---

<div class="post-metadata">

**Author:** ![aliasxneo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/df705f/32.png) [@aliasxneo](https://www.ruby-forum.com/u/aliasxneo)\
**Post date:** [December 18, 2006, 8:44pm UTC](https://www.ruby-forum.com/t/mysql-lost-connection/79696/5 "2006-12-18T20:44:17Z")

</div>

I was having the same problem on OS X. Pretty sure this is what fixed  
it:

sudo gem install mysql – --with-mysql-dir=/usr/local/mysql

I think that’s the lower level mysql interface. Sorry I seem so  
unsure, just running off the top of my head.

Tim

---

<div class="post-metadata">

**Author:** ![aliasxneo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/df705f/32.png) [@aliasxneo](https://www.ruby-forum.com/u/aliasxneo)\
**Post date:** [December 19, 2006, 2:56pm UTC](https://www.ruby-forum.com/t/mysql-lost-connection/79696/6 "2006-12-19T14:56:08Z")

</div>

We also had this error occasionally on Windows with Rails 1.2RC1 (the  
tag) before [5637]. If you’re running against the RC1 tag, switch to  
the 1.2 prerelease branch.

I doubt this applies to you, Josh, but there it is just in case.

Jason G.

---

<div class="post-metadata">

**Author:** ![aliasxneo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/df705f/32.png) [@aliasxneo](https://www.ruby-forum.com/u/aliasxneo)\
**Post date:** [December 18, 2006, 9:02pm UTC](https://www.ruby-forum.com/t/mysql-lost-connection/79696/7 "2006-12-18T21:02:19Z")

</div>

Hi Tim, this is actually a necessary step on Mac OS X due to the  
performance  
gains that one can receive. At this time, the command is as follows for  
both Mac OS X and Windows:

sudo gem install mysql –  
–with-mysql-config=/usr/local/mysql/bin/mysql\_config

-Conrad

---

<div class="post-metadata">

**Author:** ![aliasxneo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/df705f/32.png) [@aliasxneo](https://www.ruby-forum.com/u/aliasxneo)\
**Post date:** [December 19, 2006, 4:35pm UTC](https://www.ruby-forum.com/t/mysql-lost-connection/79696/8 "2006-12-19T16:35:16Z")

</div>

AliasX Neo wrote:

> > Which operating system are you running on?
> 
> I’m running on Windows XP Pro with MySQL 5.0. Where can I find an  
> alternative for Windows?

And which MySQL/Ruby adapter are you using? You could try the one I’m  
offering at [http://www.vandomburg.net/pages/mysql-ruby-windows](http://www.vandomburg.net/pages/mysql-ruby-windows). Let me  
know if that resolves your issues.

- Roderick
