Posted: Fri Oct 12, 2012 12:36 am
has anyone ever heard of a dump file?
i found some bit of software that was supposed to convert my existing database into a mysql database, and it had some problems and didn't work like it reckoned it should, but in erroring created a dump.sql file
its just a text file full of sql statements, to make all the tables with the proper field types, and then populate those tables with the data from the original database - but i was wondering how i can actually get mysql, through that phpadmin bit i guess, to execute everything in the file?
the file is just like this;
CREATE DATABASE IF NOT EXISTS `db1`;
USE `db1`;
#
# Table structure for table 'Countries'
#
DROP TABLE IF EXISTS `Countries`;
CREATE TABLE `Countries` (
`CountryID` INTEGER NOT NULL AUTO_INCREMENT,
`Country` VARCHAR(255),
`PostageArea` INTEGER,
`PostageSequence` INTEGER DEFAULT 0,
INDEX (`CountryID`),
PRIMARY KEY (`CountryID`)
) ENGINE=myisam DEFAULT CHARSET=utf8;
SET autocommit=1;
#
# Dumping data for table 'Countries'
#
INSERT INTO `Countries` (`CountryID`, `Country`, `PostageArea`, `PostageSequence`) VALUES (1, 'Afghanistan', 3, 0);
INSERT INTO `Countries` (`CountryID`, `Country`, `PostageArea`, `PostageSequence`) VALUES (2, 'Albania', 2, 0);
INSERT INTO `Countries` (`CountryID`, `Country`, `PostageArea`, `PostageSequence`) VALUES (3, 'Algeria', 3, 0);
INSERT INTO `Countries` (`CountryID`, `Country`, `PostageArea`, `PostageSequence`) VALUES (4, 'American Samoa', 3, 0);
INSERT INTO `Countries` (`CountryID`, `Country`, `PostageArea`, `PostageSequence`) VALUES (5, 'Andorra', 2, 0);
INSERT INTO `Countries` (`CountryID`, `Country`, `PostageArea`, `PostageSequence`) VALUES (6, 'Angola', 3, 0);
INSERT INTO `Countries` (`CountryID`, `Country`, `PostageArea`, `PostageSequence`) VALUES (7, 'Anguilla', 3, 0);
INSERT INTO `Countries` (`CountryID`, `Country`, `PostageArea`, `PostageSequence`) VALUES (8, 'Antarctica', 3, 0);
INSERT INTO `Countries` (`CountryID`, `Country`, `PostageArea`, `PostageSequence`) VALUES (9, 'Antigua', 3, 0);
and on and on for all the data in each table and through all the tables
actually, now i've typed this in, i could probably just write a coldfusion page to execute all this, if i can get the basic database file created and a datasource linking it with coldfusion ... hmmm
i found some bit of software that was supposed to convert my existing database into a mysql database, and it had some problems and didn't work like it reckoned it should, but in erroring created a dump.sql file
its just a text file full of sql statements, to make all the tables with the proper field types, and then populate those tables with the data from the original database - but i was wondering how i can actually get mysql, through that phpadmin bit i guess, to execute everything in the file?
the file is just like this;
CREATE DATABASE IF NOT EXISTS `db1`;
USE `db1`;
#
# Table structure for table 'Countries'
#
DROP TABLE IF EXISTS `Countries`;
CREATE TABLE `Countries` (
`CountryID` INTEGER NOT NULL AUTO_INCREMENT,
`Country` VARCHAR(255),
`PostageArea` INTEGER,
`PostageSequence` INTEGER DEFAULT 0,
INDEX (`CountryID`),
PRIMARY KEY (`CountryID`)
) ENGINE=myisam DEFAULT CHARSET=utf8;
SET autocommit=1;
#
# Dumping data for table 'Countries'
#
INSERT INTO `Countries` (`CountryID`, `Country`, `PostageArea`, `PostageSequence`) VALUES (1, 'Afghanistan', 3, 0);
INSERT INTO `Countries` (`CountryID`, `Country`, `PostageArea`, `PostageSequence`) VALUES (2, 'Albania', 2, 0);
INSERT INTO `Countries` (`CountryID`, `Country`, `PostageArea`, `PostageSequence`) VALUES (3, 'Algeria', 3, 0);
INSERT INTO `Countries` (`CountryID`, `Country`, `PostageArea`, `PostageSequence`) VALUES (4, 'American Samoa', 3, 0);
INSERT INTO `Countries` (`CountryID`, `Country`, `PostageArea`, `PostageSequence`) VALUES (5, 'Andorra', 2, 0);
INSERT INTO `Countries` (`CountryID`, `Country`, `PostageArea`, `PostageSequence`) VALUES (6, 'Angola', 3, 0);
INSERT INTO `Countries` (`CountryID`, `Country`, `PostageArea`, `PostageSequence`) VALUES (7, 'Anguilla', 3, 0);
INSERT INTO `Countries` (`CountryID`, `Country`, `PostageArea`, `PostageSequence`) VALUES (8, 'Antarctica', 3, 0);
INSERT INTO `Countries` (`CountryID`, `Country`, `PostageArea`, `PostageSequence`) VALUES (9, 'Antigua', 3, 0);
and on and on for all the data in each table and through all the tables
actually, now i've typed this in, i could probably just write a coldfusion page to execute all this, if i can get the basic database file created and a datasource linking it with coldfusion ... hmmm

