Created on 07-15-2017 10:41 AM - edited 09-16-2022 04:56 AM
I have added one user (mahi) & password is set 'hadoop' for that...also give privileges for that...but still it is not login ...give this error...could anyone give me solution for same.
Create user mahi identified by 'hadoop';
grant all on malpute.* to mahi;
Thanks
Mahendra
Created 07-15-2017 01:36 PM
The following error indicates that the database that you are trying to connect using "mahi" credentials is wither not correct or The Database is not correct.
ERROR 1045 (28000): Access denied for user 'mahi'@'localhost' (using password: YES)
.
Try this:
GRANT ALL PRIVILEGES ON *.* TO 'mahi'@'localhost'; GRANT ALL PRIVILEGES ON *.* TO 'mahi'@'%'; GRANT ALL PRIVILEGES ON *.* TO 'mahi'@'<DATABASE_FQDN>'; FLUSH PRIVILEGES;
.
Created 07-15-2017 01:36 PM
The following error indicates that the database that you are trying to connect using "mahi" credentials is wither not correct or The Database is not correct.
ERROR 1045 (28000): Access denied for user 'mahi'@'localhost' (using password: YES)
.
Try this:
GRANT ALL PRIVILEGES ON *.* TO 'mahi'@'localhost'; GRANT ALL PRIVILEGES ON *.* TO 'mahi'@'%'; GRANT ALL PRIVILEGES ON *.* TO 'mahi'@'<DATABASE_FQDN>'; FLUSH PRIVILEGES;
.
Created 07-15-2017 03:28 PM
Created 07-15-2017 04:32 PM
If the user "mahi" does not have access to "mysql" database (Which is the default Database) then you will get the same error when using t he following command.
# mysql -u mahi -p hadoop
.
You have two options.
1. Grant "mahi" user to access "mysql" (default Database)
OR
2. You should provide database name on which the "mahi" user has access. (If you want to login to any specific database)
Example:
# mysql -u mahi -p mahiDatabaseName Enter password: hadoop
Created 07-15-2017 06:06 PM
Thanks @Jay SenSharma
Finally login from that user without enter password. If enter passpword then still it is giving error.I don't know why this happend in mysql.But anyways . all is done.
# mysql -u mahi
Again thanks for helping.
Created 10-24-2017 04:16 AM
Check users info in mysql.user.
mysql> select User,Password,Host from mysql.user;
Normally, create user DDL pattern is like this below.
CREATE USER 'peter'@'localhost' IDENTFIED BY 'password';
GRANT ALL PRIGILEGES ON *.* TO 'peter'@'localhost';
CREATE USER 'peter'@'fqdn' IDENTFIED BY 'password';
GRANT ALL PRIGILEGES ON *.* TO 'peter'@'fqdn';
CREATE USER 'peter'@'%' IDENTFIED BY 'password';
GRANT ALL PRIGILEGES ON *.* TO 'peter'@'%';
FLUSH PRIVILEGES;