Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Creating a table and whatnot

Creating a table and whatnot

Creating a table and whatnot

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

RE: Creating a table and whatnot

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:



Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close