Cannot Run WP-CLI Database Import...Permission Denied

Keywords: WordPress Multisite - AWS - Technical issue - Permissions
bnsupport ID: fa6e5cdd-0c47-a8ac-9228-69878b8be186
Description:
When I attempt to run wp db import filename.sql I get an error message:

/usr/bin/env: ‘mysql’: Permission denied

OK, so given the error was Permission denied I decided to give sudo a try and of course I ended up getting this working by using sudo wp db import --alow-root filename.sql. The import was successfully processed at this point. I don’t normally have to explicitly call with sudo when using the wp db commands but I guess with this setup it’s required.

Hello @tim.nolte,

I’m glad you solved the issue! This command may have needed root permission as it changed MySQL files. Thanks for sharing the solution and do not doubt to open a new thread if your encounter any more issues in the future.

Regards,
Francisco de Paz