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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating a table and whatnot

Status
Not open for further replies.

Valen

ISP
Dec 5, 2000
12
0
0
US
I have about 3 questions concerning MySQL. Anyone that can help will be put on my "Santa please leave this guy a Ferrari" suggestion list. Although I make no claim that you will actually get one. So...

1. What kind of spacing do I use to create a table in oh say Notepad as a txt file?

2. How do I take that table that I have created in Notepad and load it into MySQL?

3. Is there anything else I need to know about this process?

Thank you and God Bless
 
Question 1:
Well, you can't exactly draw a table in Notepad and import it into MySQL (at least in its simplest state, without external programs), so your textfile should actually contain valid SQL statements for database generation. e.g. CREATE TABLE tablename(myfield1 int, myfield2 varchar(10)); etc...
Taking this into consideration, it doesn't make a darned bit of difference what your spacing is, so long as you end each statement with a semi-colon.

Question 2:
Once you create the text file, create the database (not the tables) in your mysql client (CREATE DATABASE databasename), then from the command prompt, type:
mysql -u username -p databasename < textfilename.txt

And that will import all the statements in your textfile to the actual database.

Question 3:

Nope.

brendanc@icehouse.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top