homepage Welcome to WebmasterWorld Guest from 54.235.227.60
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
phpMyAdmin problem
copy an existing sql database
amberbaby




msg:1314727
 7:43 am on Apr 15, 2003 (gmt 0)

How do I copy an existing sql database on an apache server with phpMyAdmin?
DB1= existing database
DB2= new database where I need the same data as DB1
I have root access.

Anyone?

 

Allen




msg:1314728
 7:56 am on Apr 15, 2003 (gmt 0)

Use the 'Export' to SQL feature, export the structure (and data if wanted), create the new DB, import.

Easy :)

Allen

amberbaby




msg:1314729
 9:00 am on Apr 15, 2003 (gmt 0)

How do you import the whole db?
do I have to convert it to a txt file or can I leave it as a sql file?

Thanks

grifter




msg:1314730
 2:34 pm on Apr 15, 2003 (gmt 0)

I would suggest two things:

1. .sql files *are* text files. Export to .sql file from your DB1 and open it with NotePad or a text editor, and try to understand what's going on inside. Check out different .sql files that are created as a result of choosing different options. I had a real "a ha" moment the first time I did that.

2. create a duplicate temp database for playing and testing, exporting from DB1 and importing to DB1_test on the same machine, for example. Make sure you play with and understand the options, like "add 'drop table.'" Change some data in the tables, and upload again--understand how some data can be overwritten and some can't.

amberbaby




msg:1314731
 3:52 pm on Apr 17, 2003 (gmt 0)

I know it sounds stupid but it's just not working properly. I managed to export and then import the structure, but I can't import the data, I have no idea why. I exported the data to a .sql file but it's not importing. It's probably just something silly that I'm missing.
How can I do it with comand line in SSH?

jatar_k




msg:1314732
 4:06 pm on Apr 17, 2003 (gmt 0)

[mysql.com...]

down the page it talks about "SELECT ... INTO OUTFILE" that is what you need to get the info out and then you can use load data infile to bring it back in.

If that doesn't work then you could write a script to get the data and write it to a file and then get a script to insert it as well.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved