Michael Michael - 6 months ago 15
MySQL Question

Can't login to with new passwrod to mysql console

I am new o MySQL.
I create a new user:

CREATE USER 'geo'@'localhost' IDENTIFIED BY '12345';
GRANT ALL PRIVILEGES ON *.* TO 'geo'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;


When I open MySQL console window again I type in password row a new password:

Edit Password:12345

The window is closed.

My question is why I cant login to MySQL with new password,what do I miss?

Answer

Enter to mysql as root and do following:

USE mysql;
DELETE FROM user WHERE User='geo';
GRANT ALL ON *.* TO 'geo'@'localhost' IDENTIFIED BY '12345';
GRANT ALL ON *.* TO 'geo'@'127.0.0.1' IDENTIFIED BY '12345';
FLUSH PRIVILEGES;

Or You can create user that is accessible from any IP (if mysql bind=0.0.0.0 in config, otherwise it will listen local connections):

USE mysql;
DELETE FROM user WHERE User='geo';
GRANT ALL ON *.* TO 'geo'@'%' IDENTIFIED BY '12345';
FLUSH PRIVILEGES;

Your issue I think You do create 'geo'@'localhost', but some mysql clients use 127.0.0.1 and others localhost, so for mysql these are different hosts.