Ruby on Rails
MySQL Database access problem

Symptoms

Rails can’t query MySQL at all.

Looking in the log(such as /log/development.log) you see errors such as:

<pre> ActiveRecord::StatementInvalid in Recipe#new Packets out of order: 1<>3: SHOW FIELDS FROM recipes </pre>

possible solution

MySql version 4.1.x introduced a new password hashing mechanism that is incompatible with the previously used scheme. This gave me a headache, when I tried connecting to my local MySQL using CocoaMySQL, since it doesn’t know the new scheme.

I found a hint that setting a password in MySQL with the hashing function OLD_PASSWORD('_thePass_') solves the issue. Did that, connect worked (use FLUSH PRIVILEGES; after changes to user accounts).

When I tried to get started with Rails, the above errors showed up. So I learned that Rails 0.10.1 (which I am using) know’s about the new scheme and that is incompatible with my oldstyle pass. So I ended up setting two user acccounts, one for admin with oldstyle, one for rails with new or normalstyle. Again: @FLUSH PRIVILEGES; @ ;-)

possible solution

Alternatively, you could use the new version of CocoaMySQL available from <http://www.theonline.org/cocoamysql/>. This copes with the new password mechanism of \MySQL 4.1.x. — AlisdairMcDiarmid

possible solution

Quick fix suggestion — create a local mysql user account for your rails app with NO PASSWORD. Worked for me. -Obie

possible solution

The above method did not work for me (tried both forms of hashing) but Fullmoon on #rubyonrails suggested this:

Commennting out “require ‘active_record/vendor/mysql411’” in /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.9.1/lib/active_record/connection_adapters/mysql_adapter.rb helped with my packet out of order error (with mySQL on windows)

This also worked for me on an old Redhat 7 box I had just upgraded to Rails 0.11.1.

Peter Cooper?

possible solution

This error also occurs when using ‘standard’ Rails \MySQL driver with \MySQL 4.1x. To solve it you can build the binary \MySQL extension (<http://www.tmtm.org/en/mysql/ruby/>) against the new \MySQL 4.1 libraries – Rails will use this extensioln and you will no longer experience the error — Julik Tarkhanov

possible solution

Apparently if you’re not using the old style password, this is all you need:

gem install mysql

Invalid Argument: SELECT COUNT FROM table (Win \MySQL 4.1)

This error occurs when \MySQL 4.1 is run with _old_passwords_ directive to be compatible with PHP 4.

This problem was posted on rails mailing list but no solution was provided.

possible solution

Quick and dirty solution:

  1. comment out _old_passwords_ directive in my.ini
  2. create new user (users created earlier won’t work) and use this in rails
  3. uncomment _old_passwords_ directive in my.ini

possible solution

I now recommend the gem install mysql solution mentioned above. It seems to have significantly increased the speed of database access compared to whatever it was using before. — Peter Cooper?

“gem install mysql” problems

imac:/ root# gem install mysql
Attempting local installation of 'mysql'
Local gem file not found: mysql*.gem
Attempting remote installation of 'mysql'
Updating Gem source index for: <a href="http://gems.rubyforge.org">http://gems.rubyforge.org</a>
Building native extensions.  This could take a while...
ERROR:  While executing gem ... (RuntimeError)
    ERROR: Failed to build gem native extension.
Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/mysql-2.5.1 for inspection.
  ruby extconf.rb install mysql\nchecking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsocket... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lnsl... no
checking for mysql_query() in -lmysqlclient... no

Cause

The reason this occurs is the install script cannot find your mysql library. You either do not have installed or you do not have it in a standard location.

Solution

gem install mysql -- --with-mysql-config=/path/to/your/mysql/bin/mysql_config

Most commonly, this is `/usr/local/mysql/bin/mysql_config` when this problem occurs, so the command you should use is:

gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config

possible solution (FC4)

make sure you have the following packages:

after running “gem install mysql” the first time

cd /usr/lib/ruby/gems/1.8/gems/mysql-2.7
sudo ruby extconf.rb --with-mysql-lib=/usr/lib/mysql
sudo gem install mysql

Replace the directory accordingly, the first one is where you gems are. The second directory is where you mysql libraries are.

http://mopyblue.blogspot.com/2006/04/ruby-on-rail-fc4.html

possible solution (debian etch)

sudo apt-get install libmysqlclient-dev

possible solution (kubuntu dapper drake)

sudo apt-get install libmysql-ruby

possible solution (Mac OS X Tiger 10.4.3)

Worked for me on *
bq. cd /usr/lib/ruby/gems/1.8/gems/mysql-2.7
bq. sudo ruby extconf.rb —with-mysql-config
bq. http://wiki.rubyonrails.com/rails/show/HowtoInstallOnOSXTiger

possible solution (Cygwin)

Under Cygwin, this means installing MySQL from source ; you don’t have to run MySQL from under Cygwin but you do need it installed. Also, you need to install the full server (installing with ./configure —without-server does not work)

Native Win32 users need to make sure their Ruby installer has MySQL support built in or set up their build environment so Ruby can compile against the MySQL client libraries.

possible solution

export PATH=/path/to/mysql/bin:$PATH
gem install mysql


The “gem install mysql” fix did not work for me. I have also tried changing MySQL setup to not require passwords for the database in question. I have puts statements in mysql_adapter.rb and mysql411.rb and they show that user name and database name are being read in properly from database.yml. Error now is “No database selected: SELECT COUNT(*) FROM picklists” (where picklists is the correct table in my database. I’m running what I hope are current versions: \MacOS 10.4.1, \MySQL 4.1.12-max, ruby 1.8.2, Rails as of last week.



I’m getting the same “No database selected” error. Did you get the MySQL API to install? I get an error when compiling the API so I can never run the makefile. I’m running the same versions: \MacOS 10.4.1, \MySQL 4.1.12-max, ruby 1.8.2. Anyone have any luck with the API installation?


What I see now is that if I try to use a \MySQL account that has a password, I get this response as before:

Mysql::Error in Picklist#list
Access denied for user: 'acct2@localhost' (Using password: YES)
script/server:48

My debug printout shows that the right information from database.yml is being used.

Under the same setup, using a \MySQL account with no password for the same database as before gets this response:

<a href="http://wiki.rubyonrails.com/rails/pages/NoMethodError" class="existingWikiWord">NoMethodError</a> in Picklist#list
undefined method `fetch_fields' for nil:NilClass
script/server:48

For the above “undefined method” error, installing the package from http://www.tmtm.org/en/mysql/ruby/ fixed it for me.
(a tip from http://wiki.rubyonrails.com/rails/show/HowtoInstallOnOSXTiger)


It May be as Simple as Passwords
I tried the “quick fix suggestion” (listed a few posts above) by creating a user “temp” and it worked. I then went back to look at my original user. It turned out that matching the passwords (or lack thereof) for user(s), database(s), connection(s), and database.yml fixed that user.

I happen to be using a GUI to interact with my MYSQL databases and by simply removing my passwords from my users, database connection, and database.yml I was able to get rid of the “lost connection” and “access denied for user…” errors.


If you’re on Windows you probably want to change ‘localhost’ to 127.0.0.1 in your config file. If you specify ‘localhost’ mysql client tries to connect via pipes, but MySQL server is usually set up to connect via TCP/IP on Windows.


No joy changing “localhost” to “127.0.0.1” in database.yml before starting WEBrick server. I get the same error as before. Using Mac OS X 10.4.1 by the way.


Just installed MySQL Administrator for Mac OS X, and noticed that the type for my tables is “MyISAM” rather than “InnoDB” as I have seen in some examples. Could this be making a difference? I didn’t specify the table type when I created the tables.


2errors). After compiling using gcc 3.3 everything was solved

I have Fedora Core 4, and can’t find any good information on `gcc_select`. Is it a special OS X command, or can I find it somewhere for my system? -Mike

I have posted a guide for fixing this on Fedora 4 (and hopefully other similar distros) on Ruby Forums, here’s the URL: http://ocsforums.com/showthread.php?p=462


>I have the same problem.
>Including the same error as above when trying to install mysql >extension via gem.
>I also tried to comment old_password in my.ini file and to create >a new rails user, but it didn`t work.
>However, using my old user/password and commenting the line
>require ‘active_record/vendor/mysql411’ from mysql_adapter.rb >worked for me.
>BTW: mysql 4.1.12 and windows.

Yea, I tried reinstalling, didnt try the comment old_password, flushing, following another tutorial and the only thing that worked was commenting out the mysql411 line.

- vernon

I’m using the MySQL driver written in ruby (active_record/vendor/mysql411.rb) on OS X. I was seeing the same error as above while connecting:

Access denied for user ’’@’localhost’ (using password: NO)

even though everything was specified in database.yml:

The apparent problem is that the driver was packing ints using native byte order (‘V’ and ’v’) and even hard-coded little-endien (’L’). This was causing the flags to get screwed up, creating the strange error (I suspect that a byte order problem causes the same error in mysql-ruby-2.6.x). I fixed it by replacing the packing directives with network byte order (‘N’ and ’n’):

diff old_mysql411.rb new_mysql411.rb
64c64
< @thread_id, @scramble_buff = a.slice!(0,13).unpack("La8")
—-
> @thread_id, @scramble_buff = a.slice!(0,13).unpack("Na8")
66c66
< @server_capabilities, = a.slice!(0,2).unpack("v")
—-
> @server_capabilities, = a.slice!(0,2).unpack("n")
69c69
< @server_language, @server_status = a.unpack("cv")
—-
> @server_language, @server_status = a.unpack("cn")
112c112
< template = “VVcx23a#{user.size+1}cA#{password.size}a#{db.size+1}”
—-
> template = “NNcx23a#{user.size+1}cA#{password.size}a#{db.size+1}”
114c114
< template = “VVcx23a#{user.size+1}cA#{password.size}x”
—-
> template = “NNcx23a#{user.size+1}cA#{password.size}x”

— Sergei Gnezdov – I follwed the instructions above (not mine) and they really fix the problem as of September 20, 2005.



The ActiveRecord::StatementInvalid error message can occur after the database drops the connection after an extended period of time and has been discussed on the forums http://wrath.rubyonrails.org/pipermail/rails/2005-February/002892.html
and has been logged: http://dev.rubyonrails.com/ticket/428/


If you are getting this error on some apps, but not others make sure that your script/server has:

#!/usr/bin/env ruby

and not

#!/usr/bin/ruby

I’m unsure why this works, but it worked for me. (on Mac OS X Tiger)my

—-

I used to get the dreaded No database selected error, compiling the 2.7 bindings from source solved this problem for me.

—-

I’ve got Cygwin, so I tried d/ling version 2.7 and compiling it myself, but extconf.rb doesn’t even create the makefile! Any ideas? I might just end up going back to postgres…



I’ve had the same problem with Windows/Mysql/Ruby…I have figured it would be difficult selling this to management when getting a basic driver to work is a problem

If you used the MySQL.com installer on OS X, then the location is /usr/local/mysql/bin, so the export line would be:


export PATH=/usr/local/mysql/bin:$PATH


If you are getting:

Access denied for user ’root’@’localhost’ (using password: NO)

then try this advice from the friendly folks over at TextDrive:

#!/bin/sh

killall -9 -u your_username lighttpd
killall -9 -u your_username ruby18
/usr/local/sbin/lighttpd -f /path/to/your/lighttpd.conf

The “Ruby18” may vary for you. It may be just “Ruby” or for me it was “/usr/local/bin/ruby”. You can use the following to find all the relevant processes to kill:

ps axww | grep lighttpd
ps axww | grep ruby

After trying every solution above multiple times and learning everything I should have already known about MySQL, this is the solution that finally did it for me. Rails simply wasn’t picking up any changes I had made to database.yml. Solution originally posted here: http://forum.textdrive.com/viewtopic.php?pid=34869

OR maybe you are like jonny and have a # at the beginning of your auto generated password which has the effect of commenting out your password


Connecting to mysql on Dreamhost*

Just wanted to chime in that when connecting to mysql 4.1.11 from windows, commenting the line
require ‘active_record/vendor/mysql411’ from mysql_adapter.rb worked for me.


Using:


This is another solution
I found a completely different solution at HowTosWorkerThreads

Confirmed previous post for FC4.

I am setting up Ruby on an FC4 Plesk 8 distro.
When I previously attempted to test Ruby’s ability to communicate with mySql 4.1 using the command

rake db:migrate

I got the error message
Mysql::Error: Lost connection to MySQL server during query:

I installed these components via yum (yum install mysql-devel, etc)

Followed these additional steps,


cd /usr/lib/ruby/gems/1.8/gems/mysql-2.7
sudo ruby extconf.rb —with-mysql-lib=/usr/lib/mysql
sudo gem install mysql

Now it’s working brilliantly.

Thank you.
(Paul Wolborsky @ ProjectHIRED.org

Solution – Windows XP.

To avoid logging out of windows after modifing the Environmet Variable (PATH) to add the path to “bin”, try next:

set path=%path%;"C:\Program files\MySQL\MySQL Server 5.0\bin"

Note: This will work just during the current windows session. The modification of the environment variable is unavoidable.

Hello All
I have set up ror on gentoo. The following is the error I get trying to run my app:

uninitialized constant ReleaserailController::User
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:477:in `const_missing’
/usr/local/src/releaserail/app/controllers/releaserail_controller.rb:9:in `validate’

ReleaserailController is my app-controller wherein I create an object called User by connecting to a db table called users

Any pointers why the object is not getting created. Is it because my app is unable to connect to db? the development-logs are of no help.
——————————————————————

Hi,

I have been “fighting hard” to connect to MySQL 5.0 from my rails app (the depot app described in the pragmatic guide for RoR). I have configured MySQL properly (as it is working fine from Command Line / MySQL Administrator), have installed the latest gem for mysql, have also installed the ODBC connector for rails.
My database.yml is something like this:
development:
adapter: mysql
database: depot_development
username: root
password: vaibhav
host: localhost

However, when I try to access the web page using – http://localhost:3000/admin ,
I get the following trace (sorry for pasting it here):
Mysql::Error in AdminController#index

#28000Access denied for user ’root’@’localhost’ (using password: NO)

RAILS_ROOT: ./script/../config/..
Application Trace | Framework Trace | Full Trace

c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/vendor/mysql.rb:523:in `read’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/vendor/mysql.rb:153:in `real_connect’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/connection_adapters/mysql_adapter.rb:389:in `connect’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/connection_adapters/mysql_adapter.rb:152:in `initialize’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/connection_adapters/mysql_adapter.rb:82:in `new’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/connection_adapters/mysql_adapter.rb:82:in `mysql_connection’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/connection_adapters/abstract/connection_specification.rb:262:in `send’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/connection_adapters/abstract/connection_specification.rb:262:in `connection_without_query_cache=’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/query_cache.rb:54:in `connection=’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/connection_adapters/abstract/connection_specification.rb:230:in `retrieve_connection’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/connection_adapters/abstract/connection_specification.rb:78:in `connection’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/base.rb:763:in `columns’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/calculations.rb:257:in `column_for’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/calculations.rb:116:in `calculate’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/calculations.rb:45:in `count’
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/pagination.rb:179:in `count_collection_for_pagination’
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/pagination.rb:203:in `paginator_and_collection_for’
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/pagination.rb:132:in `paginate_without_deprecation’
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/deprecation.rb:94:in `paginate’
C:/Documents and Settings/Me/My Documents/Aptana Studio/depot/app/controllers/admin_controller.rb:12:in `list’
C:/Documents and Settings/Me/My Documents/Aptana Studio/depot/app/controllers/admin_controller.rb:3:in `index’
-e:4:in `load’
-e:4

c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/vendor/mysql.rb:523:in `read’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/vendor/mysql.rb:153:in `real_connect’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/connection_adapters/mysql_adapter.rb:389:in `connect’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/connection_adapters/mysql_adapter.rb:152:in `initialize’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/connection_adapters/mysql_adapter.rb:82:in `new’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/connection_adapters/mysql_adapter.rb:82:in `mysql_connection’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/connection_adapters/abstract/connection_specification.rb:262:in `send’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/connection_adapters/abstract/connection_specification.rb:262:in `connection_without_query_cache=’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/query_cache.rb:54:in `connection=’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/connection_adapters/abstract/connection_specification.rb:230:in `retrieve_connection’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/connection_adapters/abstract/connection_specification.rb:78:in `connection’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/base.rb:763:in `columns’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/calculations.rb:257:in `column_for’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/calculations.rb:116:in `calculate’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/calculations.rb:45:in `count’
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/pagination.rb:179:in `count_collection_for_pagination’
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/pagination.rb:203:in `paginator_and_collection_for’
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/pagination.rb:132:in `paginate_without_deprecation’
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/deprecation.rb:94:in `paginate’
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/base.rb:1101:in `send’
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/base.rb:1101:in `perform_action_without_filters’
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/filters.rb:696:in `call_filters’
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/filters.rb:688:in `perform_action_without_benchmark’
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/benchmarking.rb:66:in `perform_action_without_rescue’
c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure’
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/benchmarking.rb:66:in `perform_action_without_rescue’
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/rescue.rb:83:in `perform_action’
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/base.rb:435:in `send’
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/base.rb:435:in `process_without_filters’
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/filters.rb:684:in `process_without_session_management_support’
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/session_management.rb:114:in `process’
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/base.rb:334:in `process’
c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.5/lib/dispatcher.rb:41:in `dispatch’
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1-mswin32/lib/mongrel/rails.rb:76:in `process’
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1-mswin32/lib/mongrel/rails.rb:74:in `synchronize’
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1-mswin32/lib/mongrel/rails.rb:74:in `process’
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1-mswin32/lib/mongrel.rb:155:in `process_client’
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1-mswin32/lib/mongrel.rb:154:in `each’
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1-mswin32/lib/mongrel.rb:154:in `process_client’
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1-mswin32/lib/mongrel.rb:281:in `run’
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1-mswin32/lib/mongrel.rb:281:in `initialize’
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1-mswin32/lib/mongrel.rb:281:in `new’
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1-mswin32/lib/mongrel.rb:281:in `run’
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1-mswin32/lib/mongrel.rb:264:in `initialize’
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1-mswin32/lib/mongrel.rb:264:in `new’
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1-mswin32/lib/mongrel.rb:264:in `run’
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1-mswin32/lib/mongrel/configurator.rb:282:in `run’
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1-mswin32/lib/mongrel/configurator.rb:281:in `each’
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1-mswin32/lib/mongrel/configurator.rb:281:in `run’
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1-mswin32/bin/mongrel_rails:126:in `run’
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1-mswin32/lib/mongrel/command.rb:212:in `run’
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1-mswin32/bin/mongrel_rails:279
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:488:in `load’
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:488:in `load’
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:342:in `new_constants_in’
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:488:in `load’
c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.5/lib/commands/servers/mongrel.rb:60
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require’
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require’
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:495:in `require’
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:342:in `new_constants_in’
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:495:in `require’
c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.5/lib/commands/server.rb:39
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require’
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require’
script/server:3

c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/vendor/mysql.rb:523:in `read’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/vendor/mysql.rb:153:in `real_connect’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/connection_adapters/mysql_adapter.rb:389:in `connect’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/connection_adapters/mysql_adapter.rb:152:in `initialize’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/connection_adapters/mysql_adapter.rb:82:in `new’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/connection_adapters/mysql_adapter.rb:82:in `mysql_connection’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/connection_adapters/abstract/connection_specification.rb:262:in `send’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/connection_adapters/abstract/connection_specification.rb:262:in `connection_without_query_cache=’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/query_cache.rb:54:in `connection=’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/connection_adapters/abstract/connection_specification.rb:230:in `retrieve_connection’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/connection_adapters/abstract/connection_specification.rb:78:in `connection’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/base.rb:763:in `columns’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/calculations.rb:257:in `column_for’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/calculations.rb:116:in `calculate’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/calculations.rb:45:in `count’
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/pagination.rb:179:in `count_collection_for_pagination’
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/pagination.rb:203:in `paginator_and_collection_for’
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/pagination.rb:132:in `paginate_without_deprecation’
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/deprecation.rb:94:in `paginate’
C:/Documents and Settings/Me/My Documents/Aptana Studio/depot/app/controllers/admin_controller.rb:12:in `list’
C:/Documents and Settings/Me/My Documents/Aptana Studio/depot/app/controllers/admin_controller.rb:3:in `index’
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/base.rb:1101:in `send’
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/base.rb:1101:in `perform_action_without_filters’
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/filters.rb:696:in `call_filters’
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/filters.rb:688:in `perform_action_without_benchmark’
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/benchmarking.rb:66:in `perform_action_without_rescue’
c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure’
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/benchmarking.rb:66:in `perform_action_without_rescue’
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/rescue.rb:83:in `perform_action’
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/base.rb:435:in `send’
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/base.rb:435:in `process_without_filters’
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/filters.rb:684:in `process_without_session_management_support’
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/session_management.rb:114:in `process’
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/base.rb:334:in `process’
c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.5/lib/dispatcher.rb:41:in `dispatch’
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1-mswin32/lib/mongrel/rails.rb:76:in `process’
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1-mswin32/lib/mongrel/rails.rb:74:in `synchronize’
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1-mswin32/lib/mongrel/rails.rb:74:in `process’
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1-mswin32/lib/mongrel.rb:155:in `process_client’
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1-mswin32/lib/mongrel.rb:154:in `each’
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1-mswin32/lib/mongrel.rb:154:in `process_client’
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1-mswin32/lib/mongrel.rb:281:in `run’
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1-mswin32/lib/mongrel.rb:281:in `initialize’
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1-mswin32/lib/mongrel.rb:281:in `new’
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1-mswin32/lib/mongrel.rb:281:in `run’
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1-mswin32/lib/mongrel.rb:264:in `initialize’
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1-mswin32/lib/mongrel.rb:264:in `new’
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1-mswin32/lib/mongrel.rb:264:in `run’
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1-mswin32/lib/mongrel/configurator.rb:282:in `run’
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1-mswin32/lib/mongrel/configurator.rb:281:in `each’
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1-mswin32/lib/mongrel/configurator.rb:281:in `run’
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1-mswin32/bin/mongrel_rails:126:in `run’
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1-mswin32/lib/mongrel/command.rb:212:in `run’
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1-mswin32/bin/mongrel_rails:279
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:488:in `load’
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:488:in `load’
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:342:in `new_constants_in’
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:488:in `load’
c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.5/lib/commands/servers/mongrel.rb:60
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require’
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require’
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:495:in `require’
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:342:in `new_constants_in’
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:495:in `require’
c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.5/lib/commands/server.rb:39
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require’
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require’
script/server:3
-e:4:in `load’
-e:4

Can anyone suggest a solution?
Thanks so much,
—Vaibhav

———————————————————————-
Did some tweaking and it worked! The problem was, that despite granting all previliges, it was not taking previliges for the schema objects (donnow why). I used the MySQL Administrator to grant all sort of prviliges to the root admin and now it works fine.
—Vaibhav

===========

I am running Mac OS X (10.5.2 Leopard) using bash.

I keep on getting this error when I try to migrate using mysql. The installation of the mysql 2.7 gem went smoothly.

sh-3.2# rake db:migrate
(in /company)
rake aborted!
Mysql::Error: Can’t create/write to file ‘/var/folders/4l/4lwPySMtG6OHKjCXPptBlE+++TI/-Tmp-/#sql_430_0.MYI’ (Errcode: 13): SHOW FIELDS FROM `employees`

(See full trace by running task with —trace)

If anyone has any pointers, please.
- Joe
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=