UPDATE mysql.user SET Host='%' WHERE Host='localhost' AND User='username'; UPDATE mysql.db SET Host='%' WHERE Host='localhost' AND User='username';