Ringo Blancke
Ringo Blancke

Reputation: 2444

Mysql access denied error when I try rake db:create

I install mysql for RoR, and I get an access denied error. I've tried searching on the internet for how to go about fixing this ... but I have no clue on how to proceed right now.

Basically, I did this: sudo apt-get install mysql-client mysql-server libmysql-ruby1.8

And I did get the password screen. I am sure I picked a password I know, and yet I am getting the following error when I try to run rake db:create: Access denied for user 'root'@'localhost' (using password: YES)

How can I fix this? Thanks!

Upvotes: 0

Views: 2629

Answers (2)

Jon
Jon

Reputation: 10898

Try following the instructions for resetting the root password from the official MySQL documentation:

Read this - MySQL Root Password Reset Instructions

Upvotes: 1

James Brooks
James Brooks

Reputation: 658

Are you able to connect to the database using

mysql -uroot -p -hlocalhost

or

mysql -uroot -p -h127.0.0.1

if your able to connect using the second but not the first, modify your database.yml file to include Host: 127.0.0.1 and remove the line with Socket.

Upvotes: 1

Related Questions