0

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?

Community
  • 1
  • 1
  • Everything you've done appears correct. The curious part is the error which identifies you as `' '@localhost` rather than `'jim'@localhost` suggesting something is wrong with either your mysql client or server. Perhaps get a mysql client from a different vendor? – Schwern Mar 14 '16 at 20:57

2 Answers2

0

Try this:

GRANT ALL ON *.* TO 'jim'@'%' IDENTIFIED BY 'mypasswd';
FLUSH PRIVILEGES;
Dylan Su
  • 5,975
  • 1
  • 16
  • 25
  • I logged in with "C:\Program Files (x86)\EasyPHP 13.1\binaries\mysql\bin\mysql.exe" -u jim; Then typed in what you recommended. Then got the following output "ERROR 1044 (42000): Access denied for user ' '@'localhost' to database 'publications' " and another "ERROR 1227 (42000): Access denied; you need (at least one of) the RELOAD privileges for this operation" –  Mar 15 '16 at 05:00
  • may be use jim have not enough privileges. can you use "C:\Program Files (x86)\EasyPHP 13.1\binaries\mysql\bin\mysql.exe" -u root? – Dylan Su Mar 15 '16 at 05:06
  • I am able to log in with -u root, but cannot access the database when I use the USE publications; command. I still get the ERROR 1044 message. –  Mar 15 '16 at 05:10
  • not quite sure now. I updated the post. pls try gain. – Dylan Su Mar 15 '16 at 05:12
  • Thanks anyway. Still getting an error message. Tried to log in with -u jim and -u root, with the recommended command. Got the following message ERROR 1045 (28000): Access denied for user ' '@'localhost' (using password: NO) –  Mar 15 '16 at 05:18
  • I'm even having trouble creating another database with the -u root user. Getting the same error ERROR 1044. –  Mar 15 '16 at 05:26
0

Try this:

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

Notice i remove spaces between -u and jim

Ing. Gerardo Sánchez
  • 1,607
  • 15
  • 14
  • I was able to log in, about still cannot access the database when using the USE publications; command. I still get ERROR 1044. –  Mar 15 '16 at 05:07