Today I had a strange error.

I had all privileges for a user but not able to connect via mysql_connect (PHP) or mysql (command prompt)

Tried all possible things, everything failed. Finally the below commands worked,

grant all on datag.* to ‘datag’@'%’ identified by ‘datag’;
grant all on datag.* to ‘datag’@'localhost’ identified by ‘datag’;

syntax,
grant all on .* to ‘‘@’%/localhost’ identified by ‘‘;

Share

No related posts.