MySQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMySQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old July 31st, 2004, 01:08 PM
tlpd tlpd is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 1 tlpd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Run sql script

I have one file call test.sql its contents are something like this

Create table test {
id int unsigned not null primary key,
name char(10) not null
};

then i want to run it in MySQL command line and add this file into my database (its name : books)
but i really don't know where to put this file in???

I installed MySQL at C:\mysql

So anyone can tell me where i should put test.sql in to run

I had tried it by: mysql -uusername -ppassword databasename < test.sql and got ERROR 1064. I thought my problem was the position of the test.sql file so i tried to put it somewhere in c:\mysql but i still got nothing????

Reply With Quote
  #2  
Old August 31st, 2004, 03:47 PM
Dreepa Dreepa is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 1 Dreepa User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
any luck on this?

I have run into the exact same problem.

mysql> source a.sql
error
mysql> source c:\a.sql
error
mysql> \. a.sql
error
mysql> \. c:\a.sql
error

$ mysql -u root <a.sql
error
$ mysql -u root < C:\a.sql

Nothing works.
Is there something else I need to set up?

Reply With Quote
  #3  
Old September 27th, 2007, 10:00 AM
Minnanen Minnanen is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2007
Posts: 1 Minnanen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 19 m 47 sec
Reputation Power: 0
Try inserting that line to your command line client first, you might notice there's a problem in your syntax.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMySQL Development > Run sql script


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT