Please upgrade your database: Run “bin/magento setup:upgrade” from the Magento root directory
Pergunta
I created module magento 2,but module can't run and errors exist Please upgrade your database: Run "bin/magento setup:upgrade
from the Magento root directory. "
i tried to run command bin/magento setup:upgrade
but not success,
appeared another error:
bin/magento setup:upgrade /usr/bin/env: ‘php’: No such file or directory
I am using window 10.
Solução
Try to run this command from the root directory :
php bin/magento setup:upgrade
after upgrade you can flush the cache:
php -f bin/magento cache:flush
Outras dicas
I hope this will help you
If you are using wamp server on windows then
C:\wamp\bin\php\php5.5.12>php.exe C:\wamp\www\<Magento root directory>\bin\magento setup:upgrade
in your CLI.
I follow these steps to solve this issue on my project (reference source: https://magentoexplorer.com/please-upgrade-your-database-run-binmagento-setupupgrade-from-the-magento-root-directory)
Step 1 Remove unused module table from database.
Only remove modules that are not installed on your magento store
Step 2. Go to your Magento 2 root folder and open the Git Bash. Run the following command from your ssh command interface
bin/magento setup:upgrade
Also
php bin/magento cache:clean
php bin/magento indexer:reindex
php bin/magento setup:static-content:deploy
Hope this helps with your situation