Working with Fedora Linux can cause some problems from time to time, some because of bugs, other because of something you do. Or you don't.
Anyway, when creating websites locally or developing new Joomla components and modules, you may need to have a localhost and a MySql installed locally in order to develop & test the site / extension or to develop the database behind that. I have installed a few days ago the localhost and the MySql and everything was just fine. Then, suddenly, while trying to log in to the database using some software for it I was getting all the time the error "1130 host 'localhost' is not allowed to connect to this MySql server".
The localhost was running, the MySql was active and running, everything seemed fine, but when trying to run `mysql` (with and without password, any password) I was getting errors like connecting to mysql server 'localhost' failed and access denied for user 'root'@'localhost', so commands like mysql -u root -h localhost -p or mysql -u root -h 'any ip address here' -p were out of the questions.
The solution for this was rather simple: reset mysql root password. In order to do that (at least for Fedora Linux - for other operating systems you should locate your my.cnf file) change the /etc/mysql/my.cnf configuration file and add skip-grant-tables:
[mysqld]
skip-grant-tables
Restart service and login with root without password, then change the root password using this:
set password for 'root'@'localhost' = password ('your_new_password');
Remove skip-grant-tables entry from my.cnf and restart mysql.
Note: in case you are logged in with your own Linux account (not root) you may need to log in with the root account if you don't have the rights to change the my.cnf configuration file.