dbTalk Databases Forums  

Restore from --master-data --all-databases dump

comp.databases.mysql comp.databases.mysql


Discuss Restore from --master-data --all-databases dump in the comp.databases.mysql forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
L M
 
Posts: n/a

Default Restore from --master-data --all-databases dump - 10-14-2011 , 06:13 AM






Hi,

I'm trying to restore a database in another computer/server that was
dumped as:
mysqldump -u $USER -p${KEY} --master-data=2 --all-databases > dump_file

But the restore procedure complains that one user (that has all grants
in all databases) does not exist.
ERROR 1449 (HY000) at line 28978: The user specified as a definer
('px2'@'%') does not exist

The command for restoration is:
mysql -uroot -p < dump_file

Clearly, since I ran the mysql_install_db and mysql_secure_installation,
the user 'px2'@'%' is not in the new server.
Wasn't the 'all-databases' supposed to bring the users with their
privileges for the new server?

What can I do? There is at least other admin account and several other
accounts with different privileges.


--


Luis P. Mendes

Reply With Quote
  #2  
Old   
Axel Schwenke
 
Posts: n/a

Default Re: Restore from --master-data --all-databases dump - 10-14-2011 , 07:04 AM






luislupeXXX (AT) gmailXXX (DOT) com (L M) wrote:
Quote:
I'm trying to restore a database in another computer/server that was
dumped as:
mysqldump -u $USER -p${KEY} --master-data=2 --all-databases > dump_file

But the restore procedure complains that one user (that has all grants
in all databases) does not exist.
ERROR 1449 (HY000) at line 28978: The user specified as a definer
('px2'@'%') does not exist
What statement in the dump file yields this error?
Probably a VIEW definition?

Quote:
Clearly, since I ran the mysql_install_db and mysql_secure_installation,
the user 'px2'@'%' is not in the new server.
It should be created when you load the dump. But:

$mysqldump --help
....
--flush-privileges Emit a FLUSH PRIVILEGES statement after dumping the mysql
database. This option should be used any time the dump
contains the mysql database and any other database that
depends on the data in the mysql database for proper
restore.

You need this. Whitout this option the loaded (from the
dump) MySQL accounts won't be enabled.

If you are running a very old version of MySQL (specifically:
of mysqldump) then you might be affected by this bug:

http://bugs.mysql.com/bug.php?id=21424

As a workaround you can dump the `mysql` database separately
from the other databases (use the --databases option).
Then load the `mysql` database first and run FLUSH PRIVILEGES
manually. Then load the other dump.


PS: looks like --flush-privileges defaults to false. IMHO it
should be set to true when --all-databases is used. Maybe you
should file a feature request for this.


XL

Reply With Quote
  #3  
Old   
L M
 
Posts: n/a

Default Re: Restore from --master-data --all-databases dump - 10-14-2011 , 08:05 AM



Axel Schwenke <axel.schwenke (AT) gmx (DOT) de> wrote:
Quote:
luislupeXXX (AT) gmailXXX (DOT) com (L M) wrote:

I'm trying to restore a database in another computer/server that was
dumped as:
mysqldump -u $USER -p${KEY} --master-data=2 --all-databases > dump_file

But the restore procedure complains that one user (that has all grants
in all databases) does not exist.
ERROR 1449 (HY000) at line 28978: The user specified as a definer
('px2'@'%') does not exist


It should be created when you load the dump. But:

$mysqldump --help
...
--flush-privileges Emit a FLUSH PRIVILEGES statement after dumping the mysql
database. This option should be used any time the dump
contains the mysql database and any other database that
depends on the data in the mysql database for proper
restore.

You need this. Whitout this option the loaded (from the
dump) MySQL accounts won't be enabled.

As a workaround you can dump the `mysql` database separately
from the other databases (use the --databases option).
Then load the `mysql` database first and run FLUSH PRIVILEGES
manually. Then load the other dump.

Thank you very much.

--


Luis P. Mendes

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.