I have really weird problem that I can't wrap my mind around. I'm using Debian Jessie for our servers. I've added testing repos and upgraded mysql version from 5.5 to 5.7.2 then setup private network between 2 servers:
Server A - 192.168.0.1 as database server
Server B - 192.168.0.2 as application server
I've created user and gave him all required privileges (i've tested multiple hosts and multiple variations of global and database privileges). Everything is working fine but randomly after couple days the user starts getting "Access denied" and can not log in to the database. Communication between servers works just fine, servers can ping each other and connection to mysql is not blocked as its sending Access Denied as response. I've flushed privileges many times and the user has no limits by default.
I've turned off firewall and checked system logs and I don't see anything even remotely related to my problem. I've tried all steps suggested by mysql docs where they suggest possible solutions to "Access Denied". I've tried with different app/database. I've tried many different users with both wildcard and classic hosts definitions, with different permissions and after couple days my application server is still getting "Access denied". If I log in locally on the database server and perform "Show grants" and "Show databases" everything seems fine - user has correct host and privileges yet can not log in remotely.
Application stack used for our apps is PHP with Symfony2/3. Is there anything I can do about it? Is there any software that could help me debug?
Copyright License:
Author:「blacky」,Reproduced under the CC 4.0 BY-SA copyright license with link to original source & disclaimer.
Link to:https://stackoverflow.com/questions/46891733/mysql-user-loses-privileges