Forum: Ruby on Rails MySQL

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
64d2f201af051b044c14a3cfdc423958?d=identicon&s=25 Mr. Watson (Guest)
on 2008-11-24 07:27
(Received via mailing list)
Hello,

I am having problems with MySQL.

Running: PC with Windows Vista
Installed: Instant Rails AND RoR on (http://www.rubyonrails.com)

I have edited the database.yml file.

I went to C:/InstantRails/mysql/bin>mysqladmin -u root -p root

And it says "password:".

I press enter and it shoots this error.

" mysqladmin: Unknown command: 'root' "

Any ideas?
41cc2c53544016a86472343ab3fdc0ff?d=identicon&s=25 Simon Macneall (Guest)
on 2008-11-24 07:32
(Received via mailing list)
Hi,

Remove the space between the -p and root

ie mysqladmin -u root -proot


Simon

On Mon, 24 Nov 2008 15:27:07 +0900, Mr. Watson <graphettion@gmail.com>
64d2f201af051b044c14a3cfdc423958?d=identicon&s=25 Mr. Watson (Guest)
on 2008-11-24 07:37
(Received via mailing list)
Nothing. It just gives me the help list.
41cc2c53544016a86472343ab3fdc0ff?d=identicon&s=25 Simon Macneall (Guest)
on 2008-11-24 07:42
(Received via mailing list)
Are you trying to log into the mysql command line tool to do sql queries
etc?

if so, then it isn't mysqladmin, it is just mysql
ie 'mysql -u root -proot'

if you are actually trying to do something with mysqladmin, you need to
put that command on the command line,
ie 'mysqladmin -u root -proot ping'


On Mon, 24 Nov 2008 15:37:01 +0900, Mr. Watson <graphettion@gmail.com>
64d2f201af051b044c14a3cfdc423958?d=identicon&s=25 Mr. Watson (Guest)
on 2008-11-24 07:46
(Received via mailing list)
the command "mysql -u root" worked for me.

Thanks,
64d2f201af051b044c14a3cfdc423958?d=identicon&s=25 Mr. Watson (Guest)
on 2008-11-24 08:03
(Received via mailing list)
It will let me go into mysql but I want to create a database. It is
not letting me. It says install gem mysql... I did that and got an
error. It reads "While generating documentation for mysql... MESSAGE:
Unhandled special: Special: type=17..." etc
64d2f201af051b044c14a3cfdc423958?d=identicon&s=25 Mr. Watson (Guest)
on 2008-11-24 08:28
(Received via mailing list)
I try the command "rake db:migrate" and it tells me it cannot find
libmysql.dll file.
D3fc5887a2f39f2e0c8989d39ce5e6f9?d=identicon&s=25 Bharat Ruparel (bruparel)
on 2008-11-24 14:27
(Received via mailing list)
You have to have your mysql bin directory in your PATH environment
variable.  So if you installed mysql in c:\mysql then add c:\mysql\bin
to your path.
Fac81a9d95c81d817a2debb6f717f3ac?d=identicon&s=25 Sazima (Guest)
on 2008-11-24 14:37
(Received via mailing list)
"Elementary, my dear Watson" :-)

Copy the dll to c:\windows or add it to your path.

- http://forums.mysql.com/read.php?52,37151,192816
-
http://hillemania.wordpress.com/2006/09/21/rails-m...

Also, Google is much better than Sherlock Holmes...

Cheers, Sazima
64d2f201af051b044c14a3cfdc423958?d=identicon&s=25 Mr. Watson (Guest)
on 2008-11-24 17:26
(Received via mailing list)
I did that and it worked. But I type in the "rake db:migrate" command
and it tells me " Access denied for user 'root@localhost' "
Bee69cfed999cd13e3bff73d472a39ee?d=identicon&s=25 Hassan Schroeder (Guest)
on 2008-11-24 18:14
(Received via mailing list)
On Mon, Nov 24, 2008 at 8:25 AM, Mr. Watson <graphettion@gmail.com>
wrote:
>
> I did that and it worked. But I type in the "rake db:migrate" command
> and it tells me " Access denied for user 'root@localhost' "

You need to configure config/database.yml with the appropriate
access information (username, password, etc.) for your DB.

--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
64d2f201af051b044c14a3cfdc423958?d=identicon&s=25 Mr. Watson (Guest)
on 2008-11-24 21:21
(Received via mailing list)
Everything is working correct. I can log into MySQL. Ruby on Rails is
up on running on the localhost. It created the database for me. But
every time I use the rake db:migrate command it gives me the error.

"rake aborted!
Access denied for user 'root'@'localhost' (using password: YES)

(See full trace by running task with --trace)

I ran it with trace and got the following message:
"** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:migrate
rake aborted!"

(And many system files afterwards)

Any ideas?


On Nov 24, 11:13 am, "Hassan Schroeder" <hassan.schroe...@gmail.com>
64d2f201af051b044c14a3cfdc423958?d=identicon&s=25 Mr. Watson (Guest)
on 2008-11-24 21:32
(Received via mailing list)
It is acting like it is working. For example, I typed in rake
db:migrate and it created the databse and the post.rb file. But it is
still showing the error: "Access denied for user
'root'@'localhost' (using password: YES)"
Bee69cfed999cd13e3bff73d472a39ee?d=identicon&s=25 Hassan Schroeder (Guest)
on 2008-11-24 21:36
(Received via mailing list)
On Mon, Nov 24, 2008 at 12:20 PM, Mr. Watson <graphettion@gmail.com>
wrote:
>
> Everything is working correct. I can log into MySQL. Ruby on Rails is
> up on running on the localhost. It created the database for me. But
> every time I use the rake db:migrate command it gives me the error.
>
> "rake aborted!
> Access denied for user 'root'@'localhost' (using password: YES)

That's saying that the password for root in database.yml is wrong;
are you saying that it's not? You can log in *using the exact same
information* as you've got in database.yml?

--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
64d2f201af051b044c14a3cfdc423958?d=identicon&s=25 Mr. Watson (Guest)
on 2008-11-24 21:38
(Received via mailing list)
Also, in SQL, I type "mysql -u root -p=password (as I configured the
database.yml file) and it gives me the same error.

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using
password: YES)
64d2f201af051b044c14a3cfdc423958?d=identicon&s=25 Mr. Watson (Guest)
on 2008-11-24 21:42
(Received via mailing list)
Database.yml file:

# SQLite version 3.x
#   gem install sqlite3-ruby (not necessary on OS X Leopard)
development:
  adapter: mysql
  database: depot_development
  username: root
  password: root
  host: localhost

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
  adapter: mysql
  database: depot_test
  username: root
  password: root
  host: localhost

production:
  adapter: mysql
  database: depot_production
  username: root
  password: root
  host: localhost"

I am typing in mysql -u root -p=root

On Nov 24, 2:35 pm, "Hassan Schroeder" <hassan.schroe...@gmail.com>
Bee69cfed999cd13e3bff73d472a39ee?d=identicon&s=25 Hassan Schroeder (Guest)
on 2008-11-24 21:43
(Received via mailing list)
On Mon, Nov 24, 2008 at 12:37 PM, Mr. Watson <graphettion@gmail.com>
wrote:
>
> Also, in SQL, I type "mysql -u root -p=password (as I configured the
> database.yml file) and it gives me the same error.

That should be -ppassword -- no "=", and no space separating the -p
from the actual password.

--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
64d2f201af051b044c14a3cfdc423958?d=identicon&s=25 Mr. Watson (Guest)
on 2008-11-24 21:43
(Received via mailing list)
On the end, I put the " there. It is not in the yml file.
64d2f201af051b044c14a3cfdc423958?d=identicon&s=25 Mr. Watson (Guest)
on 2008-11-24 21:46
(Received via mailing list)
I can log in with mysql -u root but it still gives me an error when
using rake db:migrate

On Nov 24, 2:35 pm, "Hassan Schroeder" <hassan.schroe...@gmail.com>
64d2f201af051b044c14a3cfdc423958?d=identicon&s=25 Mr. Watson (Guest)
on 2008-11-24 21:49
(Received via mailing list)
It still doesn't work typing "mysql -u root -proot"
Bee69cfed999cd13e3bff73d472a39ee?d=identicon&s=25 Hassan Schroeder (Guest)
on 2008-11-24 21:51
(Received via mailing list)
On Mon, Nov 24, 2008 at 12:48 PM, Mr. Watson <graphettion@gmail.com>
wrote:
>
> It still doesn't work typing "mysql -u root -proot"

Then your database.yml is *WRONG*.

If you can login to MySQL with only `mysql -u root` it means you have
*NO* password set for the root account. Which is bad. You should fix
that ASAP and then correct your database.yml.

--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
64d2f201af051b044c14a3cfdc423958?d=identicon&s=25 Mr. Watson (Guest)
on 2008-11-24 21:52
(Received via mailing list)
It still doesn't work typing "mysql -u root -proot"

On Nov 24, 2:40 pm, "Hassan Schroeder" <hassan.schroe...@gmail.com>
64d2f201af051b044c14a3cfdc423958?d=identicon&s=25 Mr. Watson (Guest)
on 2008-11-24 22:11
(Received via mailing list)
I got a password now. (I downloaded MySQL 6.0 to get it) The rake
db:migrate command is still not working.

On Nov 24, 2:40 pm, "Hassan Schroeder" <hassan.schroe...@gmail.com>
64d2f201af051b044c14a3cfdc423958?d=identicon&s=25 Mr. Watson (Guest)
on 2008-11-24 22:42
(Received via mailing list)
It works. You were right. I made a mistake on the yml.

On Nov 24, 2:50 pm, "Hassan Schroeder" <hassan.schroe...@gmail.com>
64d2f201af051b044c14a3cfdc423958?d=identicon&s=25 Mr. Watson (Guest)
on 2008-11-24 22:52
(Received via mailing list)
It works. You were right. I made a mistake on the yml.
This topic is locked and can not be replied to.