Aprile,
You need first to backup your current database.
Then create a new database.
The syntax in creating a new database is:
CREATE DATABASE [IF NOT EXISTS] db_name;
Then COPY the syntax of the tables you on your existing database.
The syntax to know how your existing tables were created is:
DESCRIBE city;
+------------+----------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+------------+----------+------+-----+---------+----------------+
| Id | int(11) | | PRI | NULL | auto_increment |
| Name | char(35) | | | | |
| Country | char(3) | | UNI | | |
| District | char(20) | YES | MUL | | |
| Population | int(11) | | | 0 | |
+------------+----------+------+-----+---------+----------------+
then with the above syntax create a table.
Example:
CREATE TABLE IF NOT EXISTS city(
Id int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
Name char(35),
Country char(3) NOT NULL UNIQUE,
District char(20),
Population int(11) default '0',
PRIMARY KEY (Id),
INDEX (country),
INDEX (district)
) ENGINE=InnoDB;
i hope this helps.
Good luck!
John
|