Yes, that is about the primary key. I'm not sure what's the primary of the logintable table but its for sure the server is trying to insert another data that has the same primary key in the table. It is better to check that if the account has logged out, it should also be removed in the logintable. If the servers has crashed or closed down, once they are restarted, the logintable must be empty. If the user tries to login and his info is still in the logintable, then add a query to update its info or just delete it and re-add the info but i think its better to just update it. And to be more safe, there should be a checker if the player has logged out safely (not closing immediately the client, but do the normal way of logging out) but there are instances that the player was disconnected from the server due to connection issues. If you're able to check these types of scenarios, then immediately disconnect the player. Or just ignore the check and just find out if the player is still in game when they try to login. Then, safely disconnect the account from the server(there might be a lot of tables related to the logintable. Find a way on how to disconnect the players maybe through a stored procedure to safely remove them from the game, then just execute that stored procedure when they try to login, only if their info is still in the logintable). The easiest way though is just to restart your distribute server everytime you encounter this error but its not recommended. Try checking the stored procedure that has something to do with the logintable and do the necessary fix. This might be a lot but these are just scenarios that might trigger the primary key constraint error in the logintable.