简体   繁体   中英

MySQL - Error 1045, access denied

EDIT : Fixed it by creating 'fakaff'@'localhost' .


First time using MySQL, using latest MAMP installation. Following the tutorial, I started by creating a database:

CREATE publications; USE publications;

Next, I created a user. I tried both variations but both give me ERROR 1045 :

GRANT ALL ON publications.* TO 'fakaff' IDENTIFIED BY '12345';

and

GRANT ALL ON publications.* TO 'fakaff@localhost' IDENTIFIED BY '12345'; 
//edit: clearly I screwed up the syntax here so it didn't work. 

When I try to log in and enter my password, I get this message:

/Applications/MAMP/Library/bin/mysqp -u fakaff -p

I get:

ERROR 1045 (28000): Access denied for user 'fakaff'@'localhost' (using password: YES)

Any idea what's causing the error? I've not played with any settings or entered any commands other than the ones I listed.

Try 'flush privileges'. It's either that, or you haven't allowed remote access, but since this is local, that shouldn't be the case.

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