Y
Y
youngmysteriouslight2018-12-18 12:32:13
MySQL
youngmysteriouslight, 2018-12-18 12:32:13

How to separate schema and constraints in mysqldump?

When I save the database structure through phpmyadmin, I get something like

CREATE TABLE IF NOT EXISTS `file` (
`id` int(11) NOT NULL,
  `name` text NOT NULL,
  `path` text NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=69 DEFAULT CHARSET=utf8;

ALTER TABLE `file`
 ADD PRIMARY KEY (`id`);

And when I do
mysqldump --opt --skip-extended-insert --complete-insert --skip-comments --no-create-info
get
CREATE TABLE `file` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` text NOT NULL,
  `path` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=69 DEFAULT CHARSET=utf8;

Is there a way to do a mysqldump so that keys, indexes, constraints, etc. are all spaced out of CREATE TABLE?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Chernykh, 2018-12-18
@youngmysteriouslight

Apparently not

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question