# MySql keeps losing connectiion (WXP+Apache2+MySql+RoR)

**URL:** <https://www.ruby-forum.com/t/mysql-keeps-losing-connectiion-wxp-apache2-mysql-ror/76571>\
**Category:** Ruby-Forum\
**Created:** [December 26, 2005, 9:52pm UTC](https://www.ruby-forum.com/t/mysql-keeps-losing-connectiion-wxp-apache2-mysql-ror/76571 "2005-12-26T21:52:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![guest](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/8dc957/32.png) [@guest](https://www.ruby-forum.com/u/guest)\
**Post date:** [December 26, 2005, 9:52pm UTC](https://www.ruby-forum.com/t/mysql-keeps-losing-connectiion-wxp-apache2-mysql-ror/76571/1 "2005-12-26T21:52:24Z")

</div>

I’ve got Apache2, MySql installed (independentally, not via a package)  
and I got RoR installed and set-up the database.yml file with correct  
username/password, etc – but RoR keeps complaining that it keeps losing  
connection;

```auto
Mysql::Error: Lost connection to MySQL server during query: SELECT 
COUNT(*) FROM categories
```

What is wrong? Why does it lose connection to MySQL server? I’ve tried  
commenting out the Mysql.sock bit and replacing the .sock path with “”;  
all I try fail – I don’t know what to do.

---

<div class="post-metadata">

**Author:** ![guest](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/8dc957/32.png) [@guest](https://www.ruby-forum.com/u/guest)\
**Post date:** [December 27, 2005, 1:01pm UTC](https://www.ruby-forum.com/t/mysql-keeps-losing-connectiion-wxp-apache2-mysql-ror/76571/2 "2005-12-27T13:01:45Z")

</div>

Please ask this question in the Rails forum.

---

<div class="post-metadata">

**Author:** ![guest](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/8dc957/32.png) [@guest](https://www.ruby-forum.com/u/guest)\
**Post date:** [February 28, 2006, 12:44am UTC](https://www.ruby-forum.com/t/mysql-keeps-losing-connectiion-wxp-apache2-mysql-ror/76571/3 "2006-02-28T00:44:10Z")

</div>

Guest wrote:

> I’ve got Apache2, MySql installed (independentally, not via a package)  
> and I got RoR installed and set-up the database.yml file with correct  
> username/password, etc – but RoR keeps complaining that it keeps losing  
> connection;
> 
> ```auto
> Mysql::Error: Lost connection to MySQL server during query: SELECT 
> > COUNT(*) FROM categories
> ```
> 
> What is wrong? Why does it lose connection to MySQL server? I’ve tried  
> commenting out the Mysql.sock bit and replacing the .sock path with “”;  
> all I try fail – I don’t know what to do.

yes, you should be asking in the Rails forum…

but I did want to mention that I encountered this problem with  
InstantRails and a new application I was building, there was a line in  
the MySQL error log…

060227 16:30:26 [Warning] mysql.user table is not updated to new  
password format; Disabling new password usage until  
mysql\_fix\_privilege\_tables is run

I tested with my root account and the ‘…Lost connection…’ problem  
disappeared, not sure what the mysql\_fix\_privilege\_tables solution  
is…but I’m sure it’s documented by the good-MySQL people out there…

Cheers,  
Andre
