wardenenv / warden

Warden is a CLI utility for orchestrating Docker based developer environments
https://warden.dev
MIT License
403 stars 167 forks source link

DB dump is not working #461

Closed MagePsycho closed 2 years ago

MagePsycho commented 2 years ago

Trying to dump the DB as

warden db dump | gzip > mydump.sql.gz

It gives an error

mysqldump: Error: 'Access denied; you need (at least one of) the PROCESS privilege(s) for this operation' when trying to dump tablespaces

May I know the correct way of dumping the DB from the container?

sprankhub commented 2 years ago

Just wanted to confirm that your command works flawlessly in my case. Not sure why it does not work for you. Make sure you use the latest Warden version and make sure to update your images via warden env pull && warden env up (just in case).

rbouma commented 2 years ago

@MagePsycho This is not a problem of warden this is a problem in user rights in mysql. You probably have a function or process in your database that is not created by the user 'magento' that warden initialize. Its either created as root or another user.

sometimes it happens we have a special price calculation function in the database thats not created as the current user then we got this error in the db if we want to see the function: -- This user does not have permission to view 'specialprice_calculation_0' This user can't dump this function, so thats the problem.

I don't know if you can dump the database with root

rbouma commented 2 years ago

@MagePsycho Please try to dump your database with this command in your root directory of your project: DB_CONTAINER=$(warden env ps -q db); docker exec $DB_CONTAINER /usr/bin/mysqldump -u root --password=magento magento > ~/path/to/database.sql It works for me

stale[bot] commented 2 years ago

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.