Accessing mysql thorugh ruby

Heres the code:

# example of connecting to mysql

require "mysql"


  dbName = "database"
  m ="localhost", "root", "password") # this line fails

  result = m.query("SELECT * FROM test")
  fields = result.fetch_fields
  fields.each do |field|



The error: "Cant connect to MySQL server on "localhost" (10061)

I accessed mysql through its window with the values I use in the line
that fails, so they are correct.

Any ideas?


Posted via