This error is generated when you are trying to access a database with a user who does not have permissions on it.
For your particular case, the user you are trying to access does not have permissions to run SELECT
on that database.
Confirm that the user exists and has permissions to access the database, if not, you must create a user and associate the same with the database in question.
The way to create the user and associate the same to the database will depend on your hosting, but you certainly have access to a cPanel administration panel where you can access to create mail accounts, databases and their users.
In exceptional cases, it has already been reported in SOEN than in queries that work with two or more tables and:
- one of them does not exist;
- or there is an error in
SELECT
where the table name is misspelled
MySQL, instead of giving the indication that the table does not exist, displays the user's lack of permissions error message against the SELECT
running.
Also confirm that the tables exist in your hosting database.