I’m new to Rails and Ruby.
I’m using the book “Agile Web Development with Rails, 1st Edition”.
As per the instructions, I created a file called create.sql in db folder of my app, following is the sql:
drop table if exists products;
create table products (
id int not null auto_increment,
title varchar(100) not null,
description text not null,
image_url varchar(200) not null,
price decimal(10,2) not null,
primary key (id)
);
And when i run the command
mysql depot_development <db/create.sql
i get an error msg
ERROR 1045 (28000) : Access denied for user ‘ODBC’@‘localhost’ (using passowrd: NO)
and when i try to use the same sql in the mysql prompt directly, it works!!
can anyone tell me why this is so?
ERROR 1045 (28000) : Access denied for user 'ODBC'@'localhost' (using
passowrd: NO)
Double check your database.yml. Make sure the username and password are
the same ones you're using on the command line (or the same as your
login account if you're not using any on the command line).