Upgrading MySQL does not need a recompile of PHP.
Everything you need to know about optimizing the speed of mysql is in themysql manual under "how compiling and linking affects the speed of mysql"
You say you've read that, so you know just about all there is to know.
An upgrade of mysql will not overwrite your old data, unless you run the "mysql_install_db" script. This script overwrites your "mysql" and "user" table,
erasing your userinfo.
Nevertheless, it's allways good practice to make a backup of your data before you upgrade any software.