'Access denied' means you are connecting to the DB server properly, but the user/host combination you're connecting as (and from) does not have permission to access the server and/or specified database. You can check the permissions from within the mysql monitor with show grants for user@hostname (e.g. whatever your DB_USER and DB_PASS defines are).
Remember that MySQL's user system is completely seperate from the operating system's user system, so having a login account on the server does not automatically grant you an account in MySQL.
Full docs on the permissions granting system are here on dev.mysql.com.
edit:
You should NEVER connect to the server as root. Create a new database user with just enough privileges you need on whatever database(s) are required. Connecting as root is just asking for trouble, including possibly opening your server up to remote compromises.
Unless your web app requires modifying tables on-the-fly, something like this should be enough permissions for most everything to work just fine:
GRANT insert,select,update,delete on somedatabase.* TO username@localhost IDENTIFIED BY 'somepassword';
And then use DB_USER = 'username' and DB_PASS = 'somepassword' in your connection
That all being said, have you verified that DB_USER, DB_PASS, and DB_SERVER are properly set inside your class? Also note that for MySQL's purposes, combinations of user@host are considered distinct accounts. 'root@localhost' and '[email protected]' may really be the same thing, but MySQL considers them utterly seperate and distinct.