Your error message indicates that for some reason you have no access to the mysql server from the Raspberry.pi.
To checkn: from your Raspberry (shell running on the RPi), can you access your mysql server, using the 'weewx' mysql name and pwd? Something like:
$ mysql -u weewx -h mysql-server -D weewx_archive -p
$ mysql -u weewx -h mysql-server -D weewx_stats -p
and then do some 'SELECT' (read access) and 'UPDATE' or 'INSERT' (write access). (to be erased after the test!).
NB:
1. the mysql user 'weewx' must have all necessary rights from a remote host, not just from the local host (default).
2. the mysql port (usually 3306) must be open on the server.
Good luck! Paul