From the download section of
www.mysql.com:
Server 4.0.17-0 9.0M Pick a mirror
MD5: 821f9cf17c1ba0e43828e4f49c93de1b
Max 4.0.17-0 1.5M Pick a mirror
MD5: da50e7086069d899a849c9684c35a016
Benchmark/test suites 4.0.17-0 1.7M Pick a mirror
MD5: c56801364ad0e70a69a92c0dcbff1e4e
Client programs 4.0.17-0 2.6M Pick a mirror
MD5: 64ff4c7fb45eb48c307e0f0e80c60d05
Libraries and header files 4.0.17-0 925.8K Pick a mirror
MD5: c26eee03c3d109337dd1bd8c0f2c8c22
Dynamic client libraries 4.0.17-0 256.6K Pick a mirror
MD5: 948b78a4c6dc6ccafd3020d1a1f13558
Embedded server 4.0.17-0 2.0M Pick a mirror
MD5: 8c179cd252d62d72a47ff9eab972390e
Dynamic client libraries
(including 3.23.x libraries) 4.0.17-0 479.4K Pick a mirror
MD5: 09af217f22374cc01a2f9964d44f6e6b
If you download the Server, Client, Header Libs, Client Llibs and Client Compat Libs (the last one) then you'll be good to go. De-install the 3.23.xx version that comes with RedHat, install these RPMs, PHP and everything else stock RedHat that uses MySQL will simply work. The last item on the download list, the -shared-compat- file is very important, it provides a 3.23.xx compatible interface to the server...