MySQL Server is losing privilages

I have an installation of MySQL 5.5 that is causing some privilege grief.

1: The server was setup and running fine since Dec 2015.
2: The server has 3 websites on it… Each site has it’s own unique user/pass to connect to MySQL
3: Just before the Christmas holidays (2016)… the primary site could not connect to the DB
4: When trying to log in as ROOT in PHPMyAdmin & the console, it also could not connect.
5: The two other sites on the server could connect… and were running fine.

TO SOLVE THIS… I DID THE FOLLOWING

1: I stopped the MySQL server
2: I created an “init” file to reset the root password (to the same it was set to)
3: I ran the mysql command… utilizing the init file.
4: I started the MySQL server

Once I did that, all privileges worked again. The primary site could connect with it’s own user/pass and I was able to log into PHPMyAdmin with the root user/pass combination.

Today… the exact same problem occurred… the same solution worked.

Has anybody encountered anything like this? The primary site and root are both affected, yet I only have to reset the root password for both to start working again. The other two user/pass combination are not affected.

Once user is created you can make sure of that by reviewing the grants for it.

show grants for ‘username’@‘hostname’;

Privileges are persistent, you don’t need any additional step to make them stay.

Check if my.cnf has something like --init-file or --skip-grant-tables. Also, how mysql is started? Does your root password gets reset as well again? Are you sure you’re connected to right mysql?

I’ll take a look at the “my.cnf” file today and check out the start up procedure.

It’s definitely the correct MySQL… and the server has been running fine for a full year before this started happening. It’s only “ROOT” and “site1” user that are losing their privileges… once I re-initialize the root user, both begin working again. Two other users (“site2” and “site3”) don’t appear to have an issue.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.