ActiveRecord Problem


#1

Ugh. ActiveRecord is giving me a hard time.

I go to connect to my mysql database on localhost, and I get rejected!
Actual IRB session:
character.rb(main):015:0* class Character < ActiveRecord::Base; end
=> nil
character.rb(main):016:0> puts Character.find(:first).firstn
Errno::ENOENT: No such file or directory - /tmp/mysql.sock
from /usr/local/lib/ruby/1.8/mysql.rb:99:in initialize' from /usr/local/lib/ruby/1.8/mysql.rb:99:innew’

So, uh, what exactly is it saying? I just installed MySQL through the
directions (word for word) from the Apple website.

Ruby 1.8.6, Mac, OS X powerpc

Thanks,
aRi
-------------------------------------------|
Nietzsche is my copilot


#2

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ari B. wrote:

So, uh, what exactly is it saying? I just installed MySQL through the
directions (word for word) from the Apple website.

It’s saying that it can’t find the MySQL socket. Check your connection
configuratiosn for ActiveRecord. See the api for
ActiveRecord::Base.establish_connection


Travis W.

“Programming in Java is like dealing with your mom –
it’s kind, forgiving, and gently chastising.
Programming in C++ is like dealing with a disgruntled
girlfriend – it’s cold, unforgiving, and doesn’t tell
you what you’ve done wrong.”
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGpmJbWvapaOIz2YYRAnlBAJ4yUoFYyf9p54mdWNcj6lfEt3R+/gCdF7o9
hTHp3KYKSZdnwb/Cz+Qddxo=
=o3g3
-----END PGP SIGNATURE-----


#3

On Jul 24, 2007, at 4:34 PM, Travis D Warlick Jr wrote:

It’s saying that it can’t find the MySQL socket. Check your
connection
configuratiosn for ActiveRecord. See the api for
ActiveRecord::Base.establish_connection

Thanks. Do you know why Mac OS X doesn’t have /tmp/mysql.sock?

aRi
--------------------------------------------|
If you’re not living on the edge,
then you’re just wasting space.


#4

On Jul 24, 2007, at 15:41 , Ari B. wrote:

Thanks. Do you know why Mac OS X doesn’t have /tmp/mysql.sock?

Maybe your MySQL server isn’t started? Can you connect to the MySQL
server through it’s command line client? (I assume it has one.)

Michael G.
grzm seespotcode net


#5

On Wed, Jul 25, 2007, Ari B. wrote:

On Jul 24, 2007, at 4:34 PM, Travis D Warlick Jr wrote:

It’s saying that it can’t find the MySQL socket. Check your
connection
configuratiosn for ActiveRecord. See the api for
ActiveRecord::Base.establish_connection

Thanks. Do you know why Mac OS X doesn’t have /tmp/mysql.sock?

The socket location is configurable, and I think by default it puts it
somewhere in /var. If you installed via DP or Fink, it’s probably
somewhere else in /opt/local. Do a locate for mysql.sock and you might
find it, otherwise go have a peek at your mysql config.

Ben


#6

How can ActiveRecord not be up-to-date to connect to my MySQL?
Here’s the error when I - not connect - but try to query the database.

CODE
character.rb(main):018:0* puts Character.find(:first).firstn
Mysql::Error: Client does not support authentication protocol
requested by server; consider upgrading MySQL client

Bwah? Not QUITE sure what that means, but I have a hunch that it’s bad.

Thanks,
-------------------------------------------------------|
~ Ari
crap my sig won’t fit


#7

On Jul 24, 2007, at 4:20 PM, Ben B. wrote:

somewhere in /var. If you installed via DP or Fink, it’s probably
somewhere else in /opt/local. Do a locate for mysql.sock and you
might
find it, otherwise go have a peek at your mysql config.

Ben

did you install on OS X using the MySQL OS X installer?
if so, it comes with several GUI tools and a System Preferences pane
for starting and stopping the MySQL server app.
it’s pretty cool and useful, and it is the best way to start/stop
MySQL on OS X.
you do also have to make sure ActiveRecord knows the username and
password for MySQL,
I don’t know how to do this part outside of Rails.
I haven’t tried using ActiveRecord independently of Rails, but as
cool and useful as it is in Rails, it must be equally great outside
of Rails. Sure beats using SQL all the time.


#8

Ari B. wrote:

How can ActiveRecord not be up-to-date to connect to my MySQL?
Here’s the error when I - not connect - but try to query the database.

CODE
character.rb(main):018:0* puts Character.find(:first).firstn
Mysql::Error: Client does not support authentication protocol requested
by server; consider upgrading MySQL client

Bwah? Not QUITE sure what that means, but I have a hunch that it’s bad.

Mysql change how it handled password encryption somewhere between
version 3.x and 5.y.

If you are using an older version of ActiveRecord you may have to update
AR or tell Mysql to use the older style of password encoding.

James