-3

I added a new user using phpmyadmin, and I get an error, and I used SQL Query :

create database foo_db;
create user foo_user identified by 'foo_password';
grant all on foo_db.* to 'foo_user'@'%';
flush privileges;

but It dosen't works too.

the error messeges was

ERROR 1045 (28000): Access denied for user 'folderfile'@'localhost' (using password: YES) (mysql) 
#1045 Cannot log in to the MySQL server (phpmyadmin)

I can't solve this problem, please help.

KarSho
  • 5,699
  • 13
  • 45
  • 78
Geunhong Kim
  • 1
  • 1
  • 1

3 Answers3

2

Try this:

CREATE USER 'testtt'@'localhost' IDENTIFIED BY '***';

GRANT ALL PRIVILEGES ON * . * TO 'testtt'@'localhost' IDENTIFIED BY '***' WITH
 GRANT OPTION MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0
 MAX_USER_CONNECTIONS 0 ;

GRANT ALL PRIVILEGES ON `test` . * TO 'testtt'@'localhost';
mamdouh alramadan
  • 8,349
  • 6
  • 36
  • 53
0

Can you login as root user? if so, please try:

1、login as root user: mysql -u root

2、use mysql

3、update user set password=NEWPASSWORD where user='folderfile' and host='localhost' ;

4 FLUSH PRIVILEGES;

Good luck!!

Weibo
  • 1,042
  • 8
  • 18
0

the problem is you haven't mentioned the host name while creating user

so try this to log into mysql

 mysql -u foo_user -h localhost -p
 Enter password: foo_password

it works no need to do any changes

vidyadhar
  • 3,118
  • 6
  • 22
  • 31