0

Basically, what I did is:

mysqldump -uroot -pxxx <some_options> --result-file Backup.sql --databases mysql customappdb

Is it sane to later do

mysql -uroot -pxxx < Backup.sql

Or do I need to take special precautions? I'm running 5.1.73-community.

JCCyC
  • 680
  • 3
  • 13
  • 24

2 Answers2

2

The only way you could mysqldump a mysql system database from one MySQL instance into another without any issues is if the major versions of MySQL are the same.

  • You can mysqldump MySQL 5.0.x systems tables and load into MySQL 5.0.x
  • You can mysqldump MySQL 5.1.x systems tables and load into MySQL 5.1.x
  • You can mysqldump MySQL 5.5.x systems tables and load into MySQL 5.5.x
  • You can mysqldump MySQL 5.6.x systems tables and load into MySQL 5.6.x

You cannot do this to higher versions or lower versions because the mysql.user table layout changes with every major release of MySQL.

See my posts on why and how to dump the system tables separately

RolandoMySQLDBA
  • 16,544
  • 3
  • 48
  • 84
0

Importing the mysql dump file 'backup.sql' would restore the system databases "mysql" along with the database customappdb.It would remove the existing system "mysql" database if it is already present there.

Regarding the import command for mysql,your syntax is correct and you can go ahead.

BDRSuite
  • 400
  • 1
  • 9