Let's say that I wanted to import a table from another server. The table is named stories. How would I go about doing it either in phpmyadmin or SSH?
Thanks for the help in advance.
Steven
| SitePoint Sponsor |
Let's say that I wanted to import a table from another server. The table is named stories. How would I go about doing it either in phpmyadmin or SSH?
Thanks for the help in advance.
Steven
Have you ever been ripped off, lied to or cheated? If so, check out
Baddealings.com
Im not an expert in this subject but couldn't you just get a mysqldump of your old database and then create a new database on the new server and then use the msqldumped file in phpmyadmin to recreate the database?





Once you mysqldump into a file named, for example, 'stories.sql,' do this:
mail -s SQLDump you@domain.tld < stories.sql
Then check your email and that is is. Paste that into your ssh connection or phpMyAdmin window.
OR...
mysqldump into http://domain.tld/stories.sql and do:
lynx -source "http://domain.tld/stories.sql" > stories.sql
mysql -u yourusername -p < stories.sql
Hope this helps...
p.s. to be a REAL wizard, you can do:
lynx -source "http://domain.tld/stories.sql" | mysql -u yourusername -p
<Edited by qslack on 01-23-2001 at 08:58 PM>
Isiru-
Thanks for the reply, and I know that your suggestion is possible. Here is what I want to do. I run a forum on my site as well as phpnuke. Now there was a hack a short time ago integrating the two. I have made the integration tonight, and I want to import my stories table, because that is where a large part of the content of my site. You see here is what I have
216.234.165.58/forums/index.php
and it should be filled with stories like
http://www.baddealings.com
So how can I do a dump of 1 table?
Thanks
Steven
<Edited by steven on 01-23-2001 at 10:04 PM>
Have you ever been ripped off, lied to or cheated? If so, check out
Baddealings.com
Here's the command you need:So how can I do a dump of 1 table?
mysqldump -uuser -ppassword --add-drop-table db_name table_name > table_name.sql
Substitute the appropriate values for the bold items. The --add-drop-table option tells MySQL to delete and recreate the table if it already exists when restoring the dump.
Once you've moved the table_name.sql file to your new server, you can restore it with the following command:
mysql -uuser -ppassword db_name < table_name.sql
Kevin Yank
CTO, sitepoint.com
I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
Baby’s got back—a hard back, that is: The Ultimate CSS Reference
Thank you guys very much for all your help as I used kyank's method and it worked perfectly in a matter of seconds.Hopefully one day I'll be answering the questions of some newbie making his day.
Have you ever been ripped off, lied to or cheated? If so, check out
Baddealings.com
Bookmarks