I cannot reporduce anything like this (just synced a lcoal and remote MySQL 4.0.26 successfully with HTTP-connection to the remote host). I have the option to try a 4.1 and 5.0 server as well, but I'll need more info about what to test!
There must some specific reason for this! Please refer to http://www.webyog.com/faq/1_26_en.html for details that are always must appreciated when reporting an issue.
Error No.1046 No database selected could be a charset issue. Are there any special characters in the database name?
You may post a simple reproduceable test case here. Preferably two very small dumps (a few rows of data will do – as long as the problem persists with them) of two DB's that behave like this