List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:March 2 2003 2:41pm
Subject:Re: Scripting MySQL Commands
View as plain text  
At 8:53 -0500 3/2/03, stiano@stripped wrote:
>I'm doing all kinds of exercises and tutorials to get up to speed on MySQL
>on my PowerBook with OS X.2 running. I just tried an exercise that, for the
>first time, had me creating a table not right in the MySQL monitor, but,
>rather, via a script that I saved as a textfile--Temp.sql--and then call
>the script up from the command line in the MySQL monitor.
>
>Here's the script:
>
>CREATE DATABASE Temp;
>USE DATABASE Temp;
>CREATE TABLE Test_Table
>	(Test_ID INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
>	Test_Name VARCHAR(30),
>	Test_Date DATETIME,
>	Test_Giver VARCHAR(30));
>INSERT INTO Test_Table
>	(Test_ID, Test_Name, Test_Date, Test_Giver)
>	VALUES
>		(NULL, 'Test','2000-03-02','Etienne');
>
>The line I used to call the script up is:
>
>bin/mysql -p <bin/mysql -p </[the complete pathname, honest]/Temp.sql
>
>I didn't get the expected result, receiving the following message:
>
>ERROR 1064: You have an error in your SQL syntax near 'bin/mysql -p
></Users/stephent/Sites/Temp.sql' at line 1
>
>Can anyone see what I've done wrong?

Type the command at the shell prompt, not after you've already invoked
mysql.  The error message is from mysql itself; it indicates that you
typed a shell command to mysql.

>
>Thank you.
>
>Steve Tiano
>
>--------------------------------------------------------------------
>mail2web - Check your email from the web at
>http://mail2web.com/ .

Thread
Scripting MySQL Commandsstiano@optonline.net2 Mar
  • Re: Scripting MySQL CommandsOliver Schlag2 Mar
  • Re: Scripting MySQL CommandsStephen Tiano2 Mar
  • Re: Scripting MySQL CommandsPaul DuBois2 Mar
  • Re: Scripting MySQL CommandsStephen Tiano2 Mar