MySQL Changes When Moving Web Server
Sometimes it happens that the web server IP address changes and previously working database connection for a PHP engine such as WordPress suddenly stops working. There need to be a couple of SQL adjustments done to fix the issue.
- Update the web server privileges to use the data base:
grant all privileges on your-database-name.* to 'your-database-user'@'new-web-server-ip-address';
flush privileges;
2. Update the web server host in the MySQL table:
update user where user='your-database-user'@'new-web-server-ip-address' identified by 'your-database-password';