The -e parameter is intended to allow you to directly execute a SQL 
statement. In this case the SQL statement you tried to execute was 
"./zztest.sql" which is not valid SQL.  You need to use the < redirector 
to tell mysql to use the file you name as an input source.

23:15$ ../bin/mysql.exe -h 10.224.3.3 -u root -p testdb < "./zztest.sql"

mysql should use the content of "./zztest.sql" as input (just as if you 
had been typing it into the console) and not as a statement to execute.

Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine

Song Ken Vern-E11804 <[EMAIL PROTECTED]> wrote on 12/22/2004 10:31:10 
AM:

> Hi, 
> 
> I am using the cygwin version of the mysql client. 
> When trying to read back my dump file into the database, I get this 
error 
> 
> ------------
> [EMAIL PROTECTED]:/cygdrive/c/Program Files/mysql/data
> 23:15$ ../bin/mysql.exe -h 10.224.3.3 -u root -p testdb -e 
"./zztest.sql" 
> Enter password: 
> ERROR 1064 at line 1: You have an error in your SQL syntax; check 
> the manual that corresponds to your MySQL server version for the 
> right syntax to use near './zztest.sql' at line 1
> ------------
> 
> The file I am trying to read back contains the first few lines :- 
> 
> ------------
> -- MySQL dump 10.7
> --
> -- Host: localhost    Database: test_irt
> -- ------------------------------------------------------
> -- Server version   4.1.3b-beta-nt-log
> /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
> /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, 
> FOREIGN_KEY_CHECKS=0 */;
> /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="NO_AUTO_VALUE_ON_ZERO" 
*/;
> 
> --
> -- Table structure for table `tasklist`
> --
> 
> CREATE TABLE `tasklist` (
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `coreid` varchar(100) NOT NULL default '',
>   `amtext` longtext NOT NULL,
>   `amcolor` varchar(100) NOT NULL default '',
>   `pmtext` longtext NOT NULL,
>   `pmcolor` varchar(100) NOT NULL default '',
>   `date` date NOT NULL default '0000-00-00',
>   PRIMARY KEY  (`id`,`coreid`,`date`)
> );
> 
> --
> -- Dumping data for table `tasklist`
> --
> 
> INSERT INTO `tasklist` VALUES 
(67,'user','test','','test','','2004-12-22');
> -------------------
> 
> However when I log into client and issue :- 
> 
> mysql> source ./zztest_irt.sql;
> Query OK, 0 rows affected (0.00 sec)
> 
> it seem to work fine. 
> 
> Is there a syntax error when running the command? 
> 
> Thanx,
> 
> Ken
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]
> 

Reply via email to