I turned on mysql logging in /etc/my.cnf. It appears that an old version of the mysql client is being used by php. The password authentication changed in later releases.
The solution was to add old_password to /etc/my.cnf so the old authentication mechanism was used whilst the wikiuser was being created and to change this back after.
Thanks
mediawiki-l@lists.wikimedia.org