Problem: Oh dear, you ran the stsadm renameserver command after you renamed the actual server name. Now you getting the dreaded Cannot connect to the configuration database error.
Never fear, there is a solution to this and its relatively easy, its worked for me.
1. Create an alias from oldservername, to newservername in mssql configuration manager. If you are using named instances for your SharePoint farm databases, setting up an alias for a named instance can be a bit tricky, but here is how its done http://bigjimindc.blogspot.com/2009/08/ms-sql-server-named-instances-and.html
2. Once the alias is done and is working, you will now be able to access the central administration. Once in, go an update the alternate access mappings in central administration , then simply run the stsadm renameserver command again.
stsadm -o renameserver -oldservername "oldserver" -newservername "newserver"
3. Now, remove the aliases (delete them)
4. Reboot server (if you can, else restart mssql and iis).
5. You should now have a working SharePoint farm again.
I believe you HAVE to run the stsadm renameserver command before you rename a actual servers name. But sometimes you cannot do this and therefore my steps above should help you fix a "broken" SharePoint farm. Well it did at least for me :-)