简体   繁体   中英

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?

Try this:

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

Try this:

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

Notice i remove spaces between -u and jim

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