# Instant Rails mySQL Error

**URL:** <https://www.ruby-forum.com/t/instant-rails-mysql-error/116509>\
**Category:** Rails\
**Created:** [October 6, 2007, 9:28am UTC](https://www.ruby-forum.com/t/instant-rails-mysql-error/116509 "2007-10-06T09:28:35Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![MrSWatson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/46a35a/32.png) [@MrSWatson](https://www.ruby-forum.com/u/MrSWatson)\
**Post date:** [October 6, 2007, 9:28am UTC](https://www.ruby-forum.com/t/instant-rails-mysql-error/116509/1 "2007-10-06T09:28:35Z")

</div>

I have tried everything in my power to get this program up and running  
and it is not working for me. I have installed RoR on my Windows XP  
machine. I have Instant Rails and Ruby on Rails and I am using Instant  
Rails to connect the mySQL database to Ruby on Rails. It is not  
working.

Everything works fine except when I create a scaffold it gives me an  
error in mySQL.  
The error reads,

“\> ruby script/generate scaffold Product Admin  
exists app/controllers/  
exists app/helpers/  
exists app/views/admin  
exists app/views/layout  
exists test/functional/  
dependency model  
exists app/models/  
exists test/unit/  
exists test/fixtures/  
identical app/models/product.rb  
identical test/unit/products.ywl  
identical test/fixtures/product.yml  
#28000Access denied for user ‘root’@‘localhost’ (using password: NO)”.

I have done this several time and continue to get the same error. Is  
there anyone that can chat with me on an instant messenger or live  
chat to help me with my problem, if possible.

---

<div class="post-metadata">

**Author:** ![MrSWatson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/46a35a/32.png) [@MrSWatson](https://www.ruby-forum.com/u/MrSWatson)\
**Post date:** [October 6, 2007, 9:47am UTC](https://www.ruby-forum.com/t/instant-rails-mysql-error/116509/2 "2007-10-06T09:47:53Z")

</div>

On Sat, 2007-10-06 at 07:27 +0000, Mr. Watson wrote:

> identical app/models/product.rb  
> identical test/unit/products.ywl  
> identical test/fixtures/product.yml  
> #28000Access denied for user ‘root’@‘localhost’ (using password: NO)".
> 
> I have done this several time and continue to get the same error. Is  
> there anyone that can chat with me on an instant messenger or live  
> chat to help me with my problem, if possible.
> 
> >

It seems that you have not specified mysql username and password  
correctly edit your config/database.yml , set proper values for mysql  
connection .

-Ajay M.

---

<div class="post-metadata">

**Author:** ![MrSWatson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/46a35a/32.png) [@MrSWatson](https://www.ruby-forum.com/u/MrSWatson)\
**Post date:** [October 6, 2007, 10:01am UTC](https://www.ruby-forum.com/t/instant-rails-mysql-error/116509/3 "2007-10-06T10:01:55Z")

</div>

You didn’t specify root’s password, if this is ok try to login to mysql  
console without password, does this allow you ?

---

<div class="post-metadata">

**Author:** ![MrSWatson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/46a35a/32.png) [@MrSWatson](https://www.ruby-forum.com/u/MrSWatson)\
**Post date:** [October 6, 2007, 9:56am UTC](https://www.ruby-forum.com/t/instant-rails-mysql-error/116509/4 "2007-10-06T09:56:03Z")

</div>

My config/database.yml files shows,

# MySQL (default setup). Versions 4.1 and 5.0 are recommended.

# 

# Install the MySQL driver:

# gem install mysql

# On MacOS X:

# gem install mysql – --include=/usr/local/lib

# On Windows:

# gem install mysql

# Choose the win32 build.

# Install MySQL and put its /bin directory on your path.

# 

# And be sure to use new-style password hashing:

# [http://dev.mysql.com/doc/refman/5.0/en/old-client.html](http://dev.mysql.com/doc/refman/5.0/en/old-client.html)

development:  
adapter: mysql  
database: depot\_development  
username: root  
password:  
host: localhost

# Warning: The database defined as ‘test’ will be erased and

# re-generated from your development database when you run ‘rake’.

# Do not set this db to the same as development or production.

test:  
adapter: mysql  
database: depot\_test  
username: root  
password:  
host: localhost

production:  
adapter: mysql  
database: depot\_production  
username: root  
password:  
host: localhost

It seems to be correct to me.

---

<div class="post-metadata">

**Author:** ![MrSWatson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/46a35a/32.png) [@MrSWatson](https://www.ruby-forum.com/u/MrSWatson)\
**Post date:** [October 6, 2007, 5:55pm UTC](https://www.ruby-forum.com/t/instant-rails-mysql-error/116509/5 "2007-10-06T17:55:41Z")

</div>

Try adding the port for mysql:

development:  
adapter: mysql  
database: depot\_development  
username: root  
password:  
host: localhost  
port: 3306

That work? This fixed another windows users issue that was very similar.

---

<div class="post-metadata">

**Author:** ![MrSWatson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/46a35a/32.png) [@MrSWatson](https://www.ruby-forum.com/u/MrSWatson)\
**Post date:** [October 7, 2007, 11:26am UTC](https://www.ruby-forum.com/t/instant-rails-mysql-error/116509/6 "2007-10-07T11:26:27Z")

</div>

hm strange …

Maybe you installed mysql separately from InstantRails ?

With InstantRails, you dont need install anything, everything is  
bundled: ruby, ror, some gems, mysql, apache, phpmyadmin for mysql…  
And mysql configured (default by Instant rails) to be set to root  
without password. thats my way on windows.

Then u start instantrails, does mysql running normally ? (3306 port) ?

Also try to run apache and browse [http://localhost/phpmyadmin](http://localhost/phpmyadmin) and get  
some access…

donate to Yulia http://www.yulia-site.org

---

<div class="post-metadata">

**Author:** ![MrSWatson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/46a35a/32.png) [@MrSWatson](https://www.ruby-forum.com/u/MrSWatson)\
**Post date:** [October 6, 2007, 12:10pm UTC](https://www.ruby-forum.com/t/instant-rails-mysql-error/116509/7 "2007-10-06T12:10:02Z")

</div>

mysql -u root

or

mysql -u root -p
