Convert ext/mysql to HNI

Part of #1480

Also includes the commit in #2024
@simonwelsh : Why is this changed from a Variant to a TypedValue*