SQLSTATE[HY000]: General error: 1 no such table: user

Home / Uncategorized / SQLSTATE[HY000]: General error: 1 no such table: user

Question:
its my first project with symfony and i tried to make a login page. i found a Tutorial (https://www.youtube.com/watch?v=3xhYwwznIWU) everything work like in the video but then i try to use "php bin/console doctrine:fixtures:load" the error :
[DoctrineDBALExceptionTableNotFoundException] An exception occurred while executing ‘DELETE FROM user’: SQLSTATE[HY000]: General error: 1 no such table: user

comes. i dont really know that i did wrong because i did everything like in the video

thx for help


Answer:
1) You have to run command update schema:
a. php bin/console doctrine:schema:update –dump-sql // show your status database if have some changes shows

b. php bin/console doctrine:schema:update –force

2) If you use Symfony2 run command with php app/console …

Your track trace error is saying user table is not exists.

And I suggest you to read always read error message (track trace) like that.

DoctrineDBALExceptionTableNotFoundException

‘DELETE FROM user’: SQLSTATE[HY000]: General error: 1 no such table: user
Read more

Leave a Reply

Your email address will not be published. Required fields are marked *