· 7 years ago · Sep 02, 2018, 06:34 PM
1Can mysqldump do one query per line?
2--
3-- Table structure for table `post`
4--
5
6CREATE TABLE IF NOT EXISTS `post` (
7 `id` int(11) NOT NULL AUTO_INCREMENT,
8 `title` varchar(160) NOT NULL,
9 `slug` varchar(255) NOT NULL,
10 `url` varchar(600) NOT NULL,
11 `domain` varchar(90) NOT NULL,
12 `author` int(11) NOT NULL,
13 `description` text,
14 `category` int(11) DEFAULT NULL,
15 `score` int(11) NOT NULL,
16 `ip` varchar(255) DEFAULT NULL,
17 `created` datetime NOT NULL,
18 `comment_count` int(11) NOT NULL DEFAULT '0',
19 PRIMARY KEY (`id`),
20 UNIQUE KEY `uc_slug` (`slug`)
21) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;
22
23-- --------------------------------------------------------
24
25--
26-- Table structure for table `users`
27--
28
29CREATE TABLE IF NOT EXISTS `users` (
30 `id` int(11) NOT NULL AUTO_INCREMENT,
31 `login` varchar(12) NOT NULL,
32 `password` varchar(45) NOT NULL,
33 `email` varchar(150) NOT NULL,
34 `about` varchar(300) DEFAULT NULL,
35 `last_visit` datetime DEFAULT NULL,
36 `ip` varchar(255) DEFAULT NULL,
37 `created` datetime NOT NULL,
38 `perm_mod` int(11) DEFAULT NULL,
39 `perm_admin` int(11) DEFAULT NULL,
40 `post_count` int(11) NOT NULL DEFAULT '0',
41 `comment_count` int(11) NOT NULL DEFAULT '0',
42 `vote_count` int(11) NOT NULL DEFAULT '0',
43 `voted_count` int(11) NOT NULL DEFAULT '0',
44 `forgot_key` varchar(150) DEFAULT NULL,
45 `cookie_key` varchar(40) DEFAULT NULL,
46 PRIMARY KEY (`id`)
47) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3;
48
49--
50-- Table structure for table `post`
51--
52
53CREATE TABLE IF NOT EXISTS `post` (`id` int(11) NOT NULL AUTO_INCREMENT,`title` varchar(160) NOT NULL,`slug` varchar(255) NOT NULL,`url` varchar(600) NOT NULL,`domain` varchar(90) NOT NULL,`author` int(11) NOT NULL,`description` text,`category` int(11) DEFAULT NULL,`score` int(11) NOT NULL,`ip` varchar(255) DEFAULT NULL,`created` datetime NOT NULL,`comment_count` int(11) NOT NULL DEFAULT '0',PRIMARY KEY (`id`),UNIQUE KEY `uc_slug` (`slug`) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;
54
55-- --------------------------------------------------------
56
57--
58-- Table structure for table `users`
59--
60
61CREATE TABLE IF NOT EXISTS `users` (`id` int(11) NOT NULL AUTO_INCREMENT,`login` varchar(12) NOT NULL,`password` varchar(45) NOT NULL,`email` varchar(150) NOT NULL,`about` varchar(300) DEFAULT NULL,`last_visit` datetime DEFAULT NULL,`ip` varchar(255) DEFAULT NULL,`created` datetime NOT NULL,`perm_mod` int(11) DEFAULT NULL,`perm_admin` int(11) DEFAULT NULL,`post_count` int(11) NOT NULL DEFAULT '0',`comment_count` int(11) NOT NULL DEFAULT '0',`vote_count` int(11) NOT NULL DEFAULT '0',`voted_count` int(11) NOT NULL DEFAULT '0',`forgot_key` varchar(150) DEFAULT NULL,`cookie_key` varchar(40) DEFAULT NULL,PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3;
62
63sed ':a;N;$!ba;s/n/THISISUNIQUESTRING/g' | sed -e 's/;THISISUNIQUESTRING/;n/g' | sed -e 's/THISISUNIQUESTRING//g'