0

I am creating an API REST aplication with Symfony3, and I have this problem. When I execute the methods in localhost it works fine, but I have uploaded the project to a server administered with Plesk, and when I try to execute the methods with postman, it shows this:

An exception occurred while executing 'SELECT t0.random_id AS ...' with params [\"a\", \"a\"]:\n\nSQLSTATE[42000]: Syntax error or access violation: 1142 SELECT command denied to user 'app'@'localhost' for table 'table_name'

It seems to be a permissions problem, but if I try to access to the database with MysQL Workbech, with the same credentials, I can do it and execute querys without problems. And in the Plesk panel, the user has all the permissions and privileges.

I have also tried changing "localhost" for the host address in the parameters file of Symfony.

1
  • 2
    post the code always Commented Oct 19, 2017 at 7:54

1 Answer 1

1

Looks like app user doesn't have permissions to execute SELECT query.

Run following MySQL query to fix it:

GRANT SELECT on database_name.* to 'app'@'localhost' identified by 'your-pass';
FLUSH PRIVILEGES;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.