# Installation problem - Lost connection to MySQL server

**URL:** <https://www.ruby-forum.com/t/installation-problem-lost-connection-to-mysql-server/98679>\
**Category:** Radiant CMS\
**Created:** [July 17, 2006, 2:21pm UTC](https://www.ruby-forum.com/t/installation-problem-lost-connection-to-mysql-server/98679 "2006-07-17T14:21:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrew](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f19dbf/32.png) [@andrew](https://www.ruby-forum.com/u/andrew)\
**Post date:** [July 17, 2006, 2:21pm UTC](https://www.ruby-forum.com/t/installation-problem-lost-connection-to-mysql-server/98679/1 "2006-07-17T14:21:33Z")

</div>

New to Ruby, having trouble installing/configuring Radiant.

Windows XP, Apache 1.3.31, MySQL 4.1.11, connecting to DB server on  
local network.

I have added host: to the database.yml.

This is what happens when I try to run the database set up.

C:\ruby\lib\ruby\gems\1.8\gems\radiant-0.5.0\>ruby script/setup\_database  
production  
Run `setup_database --help` for information on additional options.

Loading production environment…OK

WARNING! This script will overwrite information currently stored in the  
database “radiant\_live”. Are you sure you want to continue? [Yn] y

Creating tables…  
– drop\_table(“config”)  
– create\_table(“config”, {:force=\>true})  
FAILED  
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active\_record/connection\_  
adapters/abstract\_adapter.rb:120:in `log': Mysql::Error: Lost connection to MySQ L server during query: CREATE TABLE config (`id`int(11) DEFAULT NULL auto_incre ment PRIMARY KEY,`key`varchar(40) DEFAULT '' NOT NULL,`value`varchar(255) DE FAULT '') ENGINE=InnoDB (ActiveRecord::StatementInvalid) from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_recor d/connection_adapters/mysql_adapter.rb:185:in`execute’  
from  
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active\_recor  
d/connection\_adapters/abstract/schema\_statements.rb:104:in  
`create_table' from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_recor d/connection_adapters/mysql_adapter.rb:298:in`create\_table’  
from  
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active\_recor  
d/migration.rb:272:in `send' from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_recor d/migration.rb:272:in`method\_missing’  
from  
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active\_recor  
d/migration.rb:270:in `say_with_time' from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_recor d/migration.rb:256:in`measure’  
from  
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active\_recor  
d/migration.rb:256:in `say_with_time' ... 7 levels... from script/setup_database:99:in`create\_tables’  
from script/setup\_database:19:in `run' from script/setup_database:9:in`run’  
from script/setup\_database:297

Thanks  
-Andrew

---

<div class="post-metadata">

**Author:** ![andrew](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f19dbf/32.png) [@andrew](https://www.ruby-forum.com/u/andrew)\
**Post date:** [July 17, 2006, 6:16pm UTC](https://www.ruby-forum.com/t/installation-problem-lost-connection-to-mysql-server/98679/2 "2006-07-17T18:16:15Z")

</div>

Andrew wrote:

> Creating tables…  
> – drop\_table(“config”)  
> – create\_table(“config”, {:force=\>true})  
> FAILED
> 
> . . .

Yah, something is not quite right. Try this:

% script/console production  
Loading production environment.

> > Radiant::Config[‘test’] = true  
> > =\> true  
> > Radiant::Config[‘test’]  
> > =\> “1”

If you run into the same problem it indicates that something is wrong  
with your Rails setup. At that point I’d suggest that you ask the same  
question on the Rails list to see if anyone else has had a similar  
problem. See also:

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

–  
John L.  
[http://wiseheartdesign.com](http://wiseheartdesign.com)

---

<div class="post-metadata">

**Author:** ![andrew](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f19dbf/32.png) [@andrew](https://www.ruby-forum.com/u/andrew)\
**Post date:** [July 18, 2006, 9:44am UTC](https://www.ruby-forum.com/t/installation-problem-lost-connection-to-mysql-server/98679/3 "2006-07-18T09:44:23Z")

</div>

Thanks for the reply John,

Finally got it all working.

Best regards,  
Andrew

---

<div class="post-metadata">

**Author:** ![andrew](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f19dbf/32.png) [@andrew](https://www.ruby-forum.com/u/andrew)\
**Post date:** [July 19, 2006, 10:11am UTC](https://www.ruby-forum.com/t/installation-problem-lost-connection-to-mysql-server/98679/4 "2006-07-19T10:11:55Z")

</div>

John W. Long wrote:

> For people searching this list with the same problem in the future,  
> could you write up a brief description of what was actually wrong and  
> how you fixed it?

These are the steps that I took after reading John’s reply:

First I ran this: gem install mysql

Then I downloaded this MySQL adapter for windows:  
[http://www.vandomburg.net/pages/mysql-ruby-windows](http://www.vandomburg.net/pages/mysql-ruby-windows)

Extracted the mysql.so to: C:\ruby\lib\ruby\site\_ruby\1.8\i386-msvcrt

Then copied the libmysql.dll from my PHP installation to the Ruby bin:  
C:\ruby\bin

After that everything worked fine. Hope that helps out some of the  
Windows users.

---

<div class="post-metadata">

**Author:** ![andrew](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f19dbf/32.png) [@andrew](https://www.ruby-forum.com/u/andrew)\
**Post date:** [July 18, 2006, 3:28pm UTC](https://www.ruby-forum.com/t/installation-problem-lost-connection-to-mysql-server/98679/5 "2006-07-18T15:28:05Z")

</div>

Andrew wrote:

> Thanks for the reply John,
> 
> Finally got it all working.

For people searching this list with the same problem in the future,  
could you write up a brief description of what was actually wrong and  
how you fixed it?

–  
John L.  
[http://wiseheartdesign.com](http://wiseheartdesign.com)
