SQL error=Access denied for user 'xxuserxxx'@'188.8.131.52' to database 'samdb'
The mySQL at place »ABC« (your SAM PC) doesn’t allow the remote access from your web host (running samPHPweb). You have to add a remote user into your local mySQL so that your local mySQL will honour requests from your (samPHPweb) web site.
2nd post, »one more question«: The answer is (2).
Choose a secure
password! Your mySQL is open to the world and there are a lot of script kiddies out there running »mySQL database hack scripts«—I sometimes have hundreds of attack attempts a day here.
Also, it’s perfectly enough for SAM use to GRANT only SELECT, INSERT and UPDATE rights to the new user you create. (In some rare cases, it might be needed to also GRANT DELETE rights.)
Hope that helps—good luck.N.B.:
You might still get problems if your hoster won’t allow outgoing traffic on port 1221. SamPHPweb simply needs
to be able able to talk to both the mySQL and
the SAM at location »ABC«. It’s easy and simple setting this up in a secure way. You might want to change your hoster.
Or come up with some »workaround«: You might ask your hoster for another port to use on the »XYZ« server for SAM access instead and have your local router do a »port forwarding« from said port to port 1221 on your local machine.