Schema.pro
Single database restore from a full MySQL database dump

MySql reset root password

MySQL delete all tables


MySQL delete all tables

Single database restore from a full MySQL database dump

10.06 2019|MySQL

If you have a database dumps created with MySQL's --all-databases option you can restore with a simple solutions:

Extract the database dump of the single database from the --all-databases dump file with sed command:

sed -n '/^-- Current Database: `WriteSingleDatabaseNameHere`/,/^-- Current Database: `/p' FullDatabaseDumpName.sql > StrippedOutputWithSingleDataBase.sql


Then you can use:

mysql -u username -p SingleDataBaseName < ./StrippedOutputWithSingleDataBase.sql


Use this commands for extract the single database dump from the --all-databases dump file
Programming, coding, system administration linux

  
  Comment
YouTube video
Add image
OK