Results 1 to 13 of 13
  1. #1
    Join Date
    May 2010
    Posts
    6

    Unanswered: Where and How to Save at Mysql prompt

    Dear expert,

    I am forced to learn Mysql because almost web hosting company use it.

    At the mysql command prompt, I typed CREATE TABLE followed by table name, then I entered. After that, I continued typed out the database fields, specifying varchar etc Not Null until the end.

    Then, I want to save my table to a place but I do not know how-to.

    Even when I typed shows table followed by the table name...there's nothing.

    Mysql is residing in my XP....so I'm not sure if my following syntax is wrong :-

    mysql > mysqldump - u username -p password databasename.

    Is username and password created here in above line ?

    Hope some one can tell me how to. Many thanks.

  2. #2
    Join Date
    Jun 2007
    Location
    London
    Posts
    2,527
    I want to save my table to a place but I do not know how-to.
    You could just put all your table creation SQL into a file then run that file through MySQL. Not sure what you edit the sql with but most editors allow you to save the file using a file name. Alternatively you could just rely on MySQL to provide you with the script when enter :

    Code:
    show create table YourTableName
    If you have some objection to learning MySQL then why not just use a different RDBMS?

  3. #3
    Join Date
    May 2010
    Posts
    6
    What editor ? My version didn't come with an editor. I have to do everything at mysql command prompt.

    Whereabout do I create the directory for me to stored the tables?

  4. #4
    Join Date
    Nov 2003
    Posts
    2,933
    Provided Answers: 12
    Quote Originally Posted by tangara View Post
    What editor ? My version didn't come with an editor.
    But your operating system has a text editor.

  5. #5
    Join Date
    May 2010
    Posts
    6
    Do you mind to be more explicit. I know nuts about MYSQL...Been trying to put up my website for 3 coming to 1 month already but because my database is not created in MYSQL and so have been delayed till now.

    Please advise me where's the editor. Many thanks.

  6. #6
    Join Date
    Jun 2007
    Location
    London
    Posts
    2,527
    You mentioned you were on XP so you should have notepad.

    Look under : Start > accessories > notepad

  7. #7
    Join Date
    May 2010
    Posts
    6
    So, you are saying I can actually create my tables at notepad and then save it there and then. I don't even have to use MYSQL in the first place at all.

    Please confirm. If that is the case, it will be the greatest piece of News !

  8. #8
    Join Date
    Jun 2007
    Location
    London
    Posts
    2,527
    Quote Originally Posted by tangara
    Please confirm
    Confirmed.

    You will then need to pass the file through MySQL as this will create the tables etc. Most databases offer exactly this functionality and MySQL is no different. I'm sure someone could suggest a nice easy to use MySQL editor as well - sadly I can't as I use vim and I suspect you wouldn't like that at all.

  9. #9
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    unconfirmed

    notepad cannot store tables, you need mysql for that

    all notepad will do for you is allow you to muck around with the sql that will then be fed into mysql to create the tables

    are you sure you need a mysql database? why not build your web site in good old fashioned html?
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  10. #10
    Join Date
    May 2010
    Posts
    6
    Great. I can create the files in notepad.

    Could you confirm I just this files that I created in notepad and passed to the web hosting company? Is that all?

    I have earlier tried EasyPHP to create those tables and save it in .csv format and mysql - unfortunately the format is Ms Query Server SQL so they don't accept it.

    So, I just want to be sure things can be done so easily. Thanks.

  11. #11
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    my advice is to install mysql on your own computer, build your tables there, test them thoroughly, etc., before passing anything to your hosting company

    and notepad is pretty austere as a development environment, i suggest you use a tool like HiediSQL (free)
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  12. #12
    Join Date
    May 2010
    Posts
    6
    Yes. I have tried HeidiSQL. The thing is that HeidiSQL just converted my files - the sql files that I have created using EASY PHP.

    But, it changes the format to sql script.

    Can you advise if this format is accepted by the web hosting company?

  13. #13
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by tangara View Post
    Can you advise if this format is accepted by the web hosting company?
    no, i can't

    i don't know what format "easy php" generates, and i don't know what format your hosting company accepts
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •