Ok, just for the information of anyone who wants to upgrade their PHP to 5.3.1.
I found out that the problem seems to be in PHP version 5.3.1 itself and not eZ Publish 4.2.0.
MySQL Server 5.1 does not let you access databases if you are running PHP 5.3.1. The latest phpMyAdmin version 3.2.4 does not work with this version of PHP too.
I've searched for a possible cause all over. There does seem to be a backward compatibility problem between MySQL and PHP 5.3.1 if one is using older MySQL clients. Apparently, the PHP mysql_connect() function has dropped support for the OLD_PASSWORD authentification as of 5.3.1.
The new mysqlnd library necessitates the use of MySQL 4.1's newer 41-byte password format. Continued use of the old 16-byte passwords will cause mysql_connect() and similar functions to emit the error, "mysqlnd cannot connect to MySQL 4.1+ using old authentication."