Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running a mysql .zip script

Status
Not open for further replies.

Yakeni

Programmer
Jan 23, 2002
1
AU
I have a mysql script (extract.zip) which creates a db and installs all data... I have installed mysql 3.23 on 2000... When i run mysql.exe it goes strait into the mysql> but i think i need to go to the shell> to run the script below:

shell> databasename < extract.zip

the thing is how do i get into the shell> and not straight into the mysql>
 
Open a command prompt
Code:
(Start -> Programs -> Accessories -> Command Prompt)
Navigate to the mysql bin directory
Code:
c:
cd c:\mysql\bin
Run mysql.exe with input from your script
Code:
mysql < c:\your\path\to\extract.zip
Post here if you get any errors

-Rob
 
I have just started using MySQL in Windows environment. I can run SQL commands from mysql> prompt and I can use SQL to create a database table from the command line. However, I tried running a script to build a table (using exactly same SQL as I use on the command line) as follows:

mysql> @ <create.sql>;
Note: create.sql is in my c:\mysql\bin

but it keeps telling me I have an error in my SQL syntax near --repeates my command --line1.

The SQL inside the sql script (create.sql) is as follows:

Create database01.customers (fname TEXT, Lname TEXT);

I have tried leaving off the ; at end in the scrtipt also.....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top