MySQL Forums
Forum List  »  MySQL Query Browser

create new database with table
Posted by: Manhao Chen
Date: February 22, 2010 08:24PM

i'm trying to write a script that creates a new database, and creates tables/store procedures..etc.... for the newly created database, but it seems to only create the database, and not the tables..

CREATE DATABASE this_is_the_database_name;

SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for `tbl_dynamic_page_trash`
-- ----------------------------
DROP TABLE IF EXISTS `tbl_dynamic_page_trash`;
CREATE TABLE `tbl_dynamic_page_trash` (
`PK_dynamic_page_trash` int(10) NOT NULL AUTO_INCREMENT,
`file_name` varchar(50) NOT NULL,
`dynamic_page_type` varchar(8) NOT NULL,
`FK_sites` int(10) NOT NULL,
PRIMARY KEY (`PK_dynamic_page_trash`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

Options: ReplyQuote


Subject
Written By
Posted
create new database with table
February 22, 2010 08:24PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.