Добрый день, подскажите пожалуйста как добавлять бд, например books.sql [sql] create table customers ( customerid int unsigned not null auto_increment primary key, name char(30) not null, address char(40) not null, city char(20) not null }; create table orders ( ordersid int unsigned not null auto_increment primary key, customerid int unsigned not null, amount float(6,2), date date not null ); [/sql] я пытаюсь так (в командной строке): mysql -h localhost -u bumer books -p < books.sql - хочу хотя бы переназначить файл не получается, помогите пожалуйста!
термин "не получается" слегка расплывчат. Что конкретно происходит? На первый взгляд не хватает create database и commit
Код (Text): C:\Documents and Settings\BumeRoK>mysql -h localhost -u bumer -D books -p < Z:\h ome\localhost\www\Tools\phpmyadmin\books.sql Enter password: ****** C:\Documents and Settings\BumeRoK>mysql -h localhost -u bumer -D books -p Enter password: ****** Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 7 Server version: 5.0.41-community-nt MySQL Community Edition (GPL) Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> show tables; Empty set (0.00 sec) mysql> exit Bye Ну ничего не происходит, или не должно происходить. В файле находится 2 таблицы , а когда - вывод таблиц, то она пустая.