Bug #50594 mysqldump should have an option to skip definers
Submitted: 25 Jan 2010 16:27 Modified: 26 Jan 2010 7:09
Reporter: Brett Cave Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: mysqldump Command-line Client Severity:S4 (Feature request)
Version:5.1 OS:Any
Assigned to: CPU Architecture:Any
Tags: Definer, mysqldump, stored procedure, VIEW

[25 Jan 2010 16:27] Brett Cave
Description:
mysqldump with views or routines may not work if migrating to a different host with a different set of users, since the DEFINER values were added in 5.1.8.

Having a flag to mysqldump to skip definers to avoid this could be useful in many situations, where views / sp's are being migrated between servers with different users.

How to repeat:
# mysql -h localhost -u root -e "grant create routine on test.* to 'spdefiner'@localhost" -h localhost;
# mysql -u spdefiner -e "create routine my_routine ...."
# mysqldump -h localhost --routines test | mysql -h remotehost test
# mysql -h remotehost -u root -e "call my_routine()"

ERROR 1449: The user specified as a definer ('spdefiner'@'thishost') does not exist

Suggested fix:
Add a --skip-definers flag to mysqldump that will leave the definer out for safe cross-server dumps.
[25 Jan 2010 16:51] Valeriy Kravchuk
Looks like a duplicate of Bug #24680. Please, check.
[26 Jan 2010 7:09] Brett Cave
This is a duplicate of Bug #24680