简体   繁体   中英

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!

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 .

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

Read this - MySQL Root Password Reset Instructions

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM