PHP命令行PDO连接问题

I have a class and a db class all works fine with in the browser. But when i add the same DB class to another file that i then run from the terminal i et the following error:

Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [1045] Access denied for user '????@localhost' (using password: YES)'

The local test server is on a windows 7 machine running php, apache and mysql. I am doing the test via my mac and terminal.

DO i need to set the local server up further etc or am i missing any thing.

The local test server is on a windows 7 machine running php, apache and mysql. I am doing the test via my mac and terminal.

Probably you are running cli files from the Mac. You need to add 'mac' address in mysql allowed hosts in windows

see Mysql adding user for remote access