SunQuest
 
           General SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesGeneral SQL 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:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old July 13th, 2005, 05:59 AM
Bustergut Bustergut is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2005
Posts: 1 Bustergut User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 m 28 sec
Reputation Power: 0
Creating an SQL table from another table

've been stuggling with getting an Apache server running, along with PHP and MySQL on XP Home, but almost there. I created a MySQL database, but need to decrypt this bit of advice

$ mysql test < tables.my.sql where

test is the name of my database and tables.my.sql is supplied. I think it means it's trying to create predefined tables within my database from the supplied table. I'm not sure exactly what to type in. SQl 4.0.21. Anybody help ?

Reply With Quote
  #2  
Old July 13th, 2005, 02:48 PM
Madpawn Madpawn is offline
My beat is correct.
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 339 Madpawn User rank is Private First Class (20 - 50 Reputation Level)Madpawn User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 22 h 3 m 33 sec
Reputation Power: 4
That syntax is for running mysql query commands from an existing text file. For example, say you've got a database called 'test' (which you should). Create a text file called 'create_test1.sql' with the following:

Code:
CREATE TABLE test1 (
id INT,
myfoo VARCHAR(50));


Now, from your windows command line (not your mysql command line), type:

mysql test < create_test1.sql

This will run the query(ies) contained in create_test1 into the database test -- in this example, you've created the table test1.

In the context of your situation, I'm not sure what you need. If you don't have any text files you want to run, then you don't need to use this syntax.
__________________
"A pawn is the most important piece on the chessboard -- to a pawn"


Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesGeneral SQL Development > Creating an SQL table from another table


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