If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Where and How to Save at Mysql prompt

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-27-10, 04:30
tangara tangara is offline
Registered User
 
Join Date: May 2010
Posts: 6
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.
Reply With Quote
  #2 (permalink)  
Old 05-27-10, 07:05
mike_bike_kite mike_bike_kite is offline
vaguely human
 
Join Date: Jun 2007
Location: London
Posts: 2,519
Quote:
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?
__________________
Mike
Reply With Quote
  #3 (permalink)  
Old 05-27-10, 11:07
tangara tangara is offline
Registered User
 
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?
Reply With Quote
  #4 (permalink)  
Old 05-27-10, 11:14
shammat shammat is offline
Registered User
 
Join Date: Nov 2003
Posts: 2,407
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.
Reply With Quote
  #5 (permalink)  
Old 05-27-10, 12:20
tangara tangara is offline
Registered User
 
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.
Reply With Quote
  #6 (permalink)  
Old 05-27-10, 12:33
mike_bike_kite mike_bike_kite is offline
vaguely human
 
Join Date: Jun 2007
Location: London
Posts: 2,519
You mentioned you were on XP so you should have notepad.

Look under : Start > accessories > notepad
__________________
Mike
Reply With Quote
  #7 (permalink)  
Old 05-27-10, 21:10
tangara tangara is offline
Registered User
 
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 !
Reply With Quote
  #8 (permalink)  
Old 05-28-10, 05:34
mike_bike_kite mike_bike_kite is offline
vaguely human
 
Join Date: Jun 2007
Location: London
Posts: 2,519
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.
__________________
Mike
Reply With Quote
  #9 (permalink)  
Old 05-28-10, 08:25
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,525
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?
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #10 (permalink)  
Old 05-28-10, 08:29
tangara tangara is offline
Registered User
 
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.
Reply With Quote
  #11 (permalink)  
Old 05-28-10, 08:54
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,525
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)
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #12 (permalink)  
Old 05-28-10, 10:25
tangara tangara is offline
Registered User
 
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?
Reply With Quote
  #13 (permalink)  
Old 05-28-10, 10:41
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,525
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
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On