ActiveRecord Problem

A

Ari Brown

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:in `new'

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
 
T

Travis D Warlick Jr

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

Ari said:
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:in `new'

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 Warlick

"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-----
 
A

Ari Brown

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.
 
M

Michael Glaesemann

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 Glaesemann
grzm seespotcode net
 
B

Ben Bleything

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
 
J

John Joyce

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
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.
 
A

Ari Brown

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
 
J

James Britt

Ari said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top