# Newbie and MySQL

**URL:** <https://www.ruby-forum.com/t/newbie-and-mysql/102468>\
**Category:** Rails\
**Created:** [February 8, 2006, 6:39pm UTC](https://www.ruby-forum.com/t/newbie-and-mysql/102468 "2006-02-08T18:39:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bryce](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/8edcca/32.png) [@Bryce](https://www.ruby-forum.com/u/Bryce)\
**Post date:** [February 8, 2006, 6:39pm UTC](https://www.ruby-forum.com/t/newbie-and-mysql/102468/1 "2006-02-08T18:39:55Z")

</div>

Please forgive me if this has been answered in another post. I’ve looked  
around but couldn’t find a solution.

I bought the book “Agile Web D. with Rails” and think I’m going  
to really like it. I went through the first chapter with no problems.  
However, as I begin developing the database on page 57, I get a  
consitent error:

Before updating scaffolding from new DB schema, try creating a table for  
your model (Products)

I’ve changed all the parameters in the database.yml file 100 times  
including the username, password, socket and taking the underscore out  
of the databases it is connecting to.

My error logs read:

[4;36;1mProducts Columns (0.000000)^[[0m ^[[0;1mMysql::Error: Lost  
connection to MySQL server during query: SHOW FIELDS FROM products^[[0m

I tried to do: gem install mysql  
but it eventually errored and failed.

I’m running a box with FC 4, Mysql 4.1 and Ruby 1.0  
Any help would be greatly appreciated, I’m not even sure where to start.

Bryce

---

<div class="post-metadata">

**Author:** ![Bryce](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/8edcca/32.png) [@Bryce](https://www.ruby-forum.com/u/Bryce)\
**Post date:** [February 8, 2006, 11:04pm UTC](https://www.ruby-forum.com/t/newbie-and-mysql/102468/2 "2006-02-08T23:04:30Z")

</div>

I had this problem too. This worked for me, from the Rails Wiki.

The install process may be looking for mysql in the wrong place, so make  
a symbolic link:

ln -s /usr/lib/mysql /usr/local/lib/mysql

[http://wiki.rubyonrails.org/rails/pages/MySQL+Database+access+problem](http://wiki.rubyonrails.org/rails/pages/MySQL+Database+access+problem)

---

<div class="post-metadata">

**Author:** ![Bryce](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/8edcca/32.png) [@Bryce](https://www.ruby-forum.com/u/Bryce)\
**Post date:** [February 8, 2006, 11:33pm UTC](https://www.ruby-forum.com/t/newbie-and-mysql/102468/3 "2006-02-08T23:33:37Z")

</div>

Bil Herron wrote:

> The install process may be looking for mysql in the wrong place, so make  
> a symbolic link:
> 
> ln -s /usr/lib/mysql /usr/local/lib/mysql

Thanks a ton Bil. This problem drove me nuts for a good day or so. What  
finally worked was this:

ln -s /usr/lib/mysql /usr/local/lib/mysql  
gem mysql install

after that there were no errors. I really appreciate your help.  
Bryce

---

<div class="post-metadata">

**Author:** ![Bryce](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/8edcca/32.png) [@Bryce](https://www.ruby-forum.com/u/Bryce)\
**Post date:** [February 8, 2006, 11:56pm UTC](https://www.ruby-forum.com/t/newbie-and-mysql/102468/4 "2006-02-08T23:56:50Z")

</div>

This still doesn’t work for me. I get the …

\*\*\* extconf.rb failed \*\*\*  
Could not create Makefile due to some reason, probably lack of  
necessary libraries and/or headers. Check the mkmf.log file for more  
details. You may need configuration options.

So I run…

ruby extconf.rb --with-mysql-dir=/var/lib/mysql/

(With many other directories for the actual dir path.) But still no go.

What the hell? 🙂

- Rabbit

* * *
