Check the permissions for the username and pass you are using to connect to the database.
View SQL manual chapter 6.13 for what I mean.
For instance if you set up the name "User", most places only do:
GRANT ALL PRIVILEGES ON . TO
User@localhost
IDENTIFIED BY 'some_pass' WITH GRANT OPTION;
to give them full access. However, that middle line means you can access only through localhost.
If you are set up that way you'd need to do this:
GRANT ALL PRIVILEGES ON . TO
User@"%"
IDENTIFIED BY 'some_pass' WITH GRANT OPTION;
So you can access the database from any location.
I'm guessing that's the problem you're having, but I'm guessing the syntax is a little different for changing the settings of the root user.