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

copying table

Status
Not open for further replies.

johno77

Technical User
Nov 1, 2003
40
0
0
GB
Hello

I am not very familiar with mysql but am having to port a table i have created to another machine. I am running the latest mysql. Could someone please inform me how this is possible from the command line.

thanks
 
if you have phpmyadmin you can export you're table with structure and data as an sql statement. you can run that statement on the other machine in mysql and everything is the same then.

sorry don't know how to do this from commandline


 
if both machines have mysql the either use PhpMyAdsmin as hos2 suugested or if any one of them is Windows then u can try MySql Front from
Alternatively, cmd line options are
From Unix cmd line
Code:
mysqldump  -e --add-drop-table -u username -h mysqlserver -p dbname tablename > tbl.sql
and resotre as (on unix cmd line)
Code:
mysql -u user -h 2ndserver -p newdbname < tbl.sql
alternatively from mysql prompt
Code:
select * into tbl.txt FROM mytable
here u require FILE privilege. u cans also import/export as CSV format




[ponder]
----------------
ur feedback is a very welcome desire
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top