Once I decided to use Denwer with PHP5 and MySQL4, but after transferring my base there and the site immediately ran into the problem of "questions" when receiving data and displaying them on the site. As a result of a long search and having tried many options, I still found a solution:
add / change to the /usr/local/mysql4/my.cnf file
To the [mysqld] section
default-character-set = cp1251
character-set-server = cp1251
collation-server = cp1251_general_ci
init-connect = "SET NAMES cp1251"
skip-character-set-client-handshake
')
To section [mysqldump]
default-character-set = cp1251
PS I understand perfectly well that for most people who are professionally involved in programming in general and using MySQL in particular, this information has long been known. But I hope that for beginners (as well as for many non-beginners), this information will save a few minutes of life and save you from those searches that I once did.