Another format, Native MS Excel, is available after further software installation and
configuration. (See the section Native MS Excel in this chapter.)
Even if we can export from phpMyAdmin into all these formats, only
the SQL and CSV formats can be imported back using the current
phpMyAdmin version. Use only these two formats for backup.
We shall now discuss the formats (and the options available once they have been
chosen) that can be selected with the Export sub-panel.
SQL
We will start by clicking Select All; we want all the tables. We know that the tables are
small, so the on-screen export will not be too large. For the moment, let's deselect the
Extended inserts checkbox. We then click Go, which produces the following output:
-- phpMyAdmin SQL Dump
-- version 2.11.0
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Sep 16, 2007 at 12:55 PM
-- Server version: 5.0.45
-- PHP Version: 5.2.4
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
--
-- Database: `marc_book`
--
Exporting Structure and Data
[ 118 ]
----------------------------------------------------------
--
-- Table structure for table `author`
--
CREATE TABLE IF NOT EXISTS `author` (
`id` int(11) NOT NULL,
`name` varchar(30) NOT NULL,
`phone` varchar(30) default NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `author`
--
INSERT INTO `author` (`id`, `name`, `phone`) VALUES(1, 'John Smith', '+01
445-789-1234');
INSERT INTO `author` (`id`, `name`, `phone`) VALUES(2, 'Maria Sunshine',
'333-3333');
-- --------------------------------------------------------
--
-- Table structure for table `book`
--
CREATE TABLE IF NOT EXISTS `book` (
`isbn` varchar(25) NOT NULL,
`title` varchar(100) NOT NULL,
`page_count` int(11) NOT NULL,
`author_id` int(11) NOT NULL,
`language` char(2) NOT NULL default 'en',
`description` text NOT NULL,
`cover_photo` blob NOT NULL,
`genre` set('Fantasy','Child','Novel') NOT NULL default 'Fantasy',
`date_published` datetime NOT NULL,
`stamp` timestamp NOT NULL default '0000-00-00 00:00:00' on update
CURRENT_TIMESTAMP,
`some_bits` bit(3) NOT NULL,
PRIMARY KEY (`isbn`),
KEY `by_title` (`title`(30)),
KEY `author_language` (`author_id`,`language`),
KEY `isbn` (`isbn`),
FULLTEXT KEY `description` (`description`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `book`
--
INSERT INTO `book` (`isbn`, `title`, `page_count`, `author_id`,
`language`, `description`, `cover_photo`, `genre`, `date_published`,
`stamp`, `some_bits`) VALUES('1-234567-89-0', 'A hundred years of cinema
(volume 1)', 600, 1, 'en', '', 0x89504e470d0a1a0a0000000d494844, '',
'0000-00-00 00:00:00', '2007-09-08 14:14:35', '_');
Chapter 7
[ 119 ]
INSERT INTO `book` (`isbn`, `title`, `page_count`, `author_id`,
`language`, `description`, `cover_photo`, `genre`, `date_published`,
`stamp`, `some_bits`) VALUES('1-234567-22-0', 'Future souvenirs', 200, 2,
'en', '', '', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '\0');
INSERT INTO `book` (`isbn`, `title`, `page_count`, `author_id`,
`language`, `description`, `cover_photo`, `genre`, `date_published`,
`stamp`, `some_bits`) VALUES('1-234567-90-0', 'A hundred years of cinema
(volume 2)', 602, 1, 'en', '', '', '', '0000-00-00 00:00:00', '0000-00-00
00:00:00', '\0');
In this export example, the data for one of the books (starting with 0x8950) has been
truncated for brevity.
Pages:
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127