Problem: User "root" can't logged in normal terminal, but can login on super user terminal only a.k.a sudo
.
Solution:
1.) Login as sudo.
sudo mysql -u root
2.) Check if root
user is exists (actually this is optional).
SELECT User,Host FROM mysql.user;
3.) Delete root user in MySQL.
DROP USER 'root'@'localhost';
4.) Create the root user again.
CREATE USER 'root'@'%' IDENTIFIED BY '';
5.) Setup permission for the new user.
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%';
FLUSH PRIVILEGES;
Logout from MySQL (quit) then try login back with normal terminal user, it should be fixed.
Top comments (0)