Exporting several databases to a single file

tonymarston's profile image tonymarston posted 4 years ago in General Permalink

When I use the "Export database as SQL" option on several databases at the same time, and put the output into the clipboard or a single sql file, there is no "use database;" statement at the start of the commands for each database which causes the script to fail. I therefore have to amend the output manually before I can run it.

Please can you insert a "use" statement at the start of each database.

ansgar's profile image ansgar posted 4 years ago Permalink

That USE xyz is only added when you activate the creation of databases:

Description

-- Dumping database structure for test4
CREATE DATABASE IF NOT EXISTS `test4` /*!40100 DEFAULT CHARACTER SET utf8mb4 */;
USE `test4`;

-- Dumping structure for table test4.bigids
CREATE TABLE IF NOT EXISTS `bigids` (
  `id` decimal(30,0) unsigned NOT NULL DEFAULT 0,
  `name` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

Please login to leave a reply, or register at first.