user3142523
user3142523

Reputation:

ERROR 1044 (42000) : Access denied for user ' '@localhost to database

Having trouble logging in and accessing my database. Currently using Windows 10 EasyPHP 13.1

I tried logging into my database. Using

          "C:\Program Files (x86)\EasyPHP 13.1\binaries\mysql\bin\mysql.exe" -u  jim -p;

An error message appeared saying WARNING: Using a password on the command line interface can be insecure ERROR 1045 (28000): Access Denied for user 'jim'@'localhost' (using password: YES). Then I tried

            "C:\Program Files (x86)\EasyPHP 13.1\binaries\mysql\bin\mysql.exe" -u  jim;

This logged me in. However, I still cannot access the database. Whenever I type the following command.

 USE publications;

I get the error

ERROR 1044 (42000) : Access denied for user  ' '@localhost to database 'publications'

I have even tried the following

  GRANT ALL ON publications.* TO 'jim' IDENTIFIED BY 'mypasswd';

and

  GRANT ALL ON publications.* TO 'jim'@'localhost' IDENTIFIED BY 'mypasswd';

and

     GRANT ALL PRIVILEGES ON *.* TO 'jim'@'localhost' WITH GRANT OPTION;

as recommended at mysql> use mysql; but ... ERROR 1044 (42000): Access denied for user '' @ 'localhost' to database 'mysql'

Even Logging in as a -u root won't let me access the database. I'm at a loss as to what the problem might be. Any ideas?

Upvotes: 0

Views: 3072

Answers (2)

Dylan Su
Dylan Su

Reputation: 6065

Try this:

GRANT ALL ON *.* TO 'jim'@'%' IDENTIFIED BY 'mypasswd';
FLUSH PRIVILEGES;

Upvotes: 0

Try this:

"C:\Program Files (x86)\EasyPHP 13.1\binaries\mysql\bin\mysql.exe" -ujim

Notice i remove spaces between -u and jim

Upvotes: 0

Related Questions