GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Simple MySQL problem (https://gfy.com/showthread.php?t=139640)

Tipsy 06-03-2003 04:17 PM

Simple MySQL problem
 
I want to copy the entire contents of a database on the same server, using the same host, user etc to a new database with a different name. Is there an easier way to do it rather than backing it up and restoring it with a new name?

JDog 06-03-2003 04:22 PM

do you have root to the box? because you should just be able to just copy the db files into the directory of mysql under the new DB name! That should be it.

jDoG

cash69 06-03-2003 04:23 PM

c:\winnt\system32\msql\ copy those.. duno about linux :thumbsup

Tipsy 06-03-2003 04:28 PM

Quote:

Originally posted by JDog
do you have root to the box? because you should just be able to just copy the db files into the directory of mysql under the new DB name! That should be it.

jDoG

Now that's almost too obvious :) I'll give it a try and if it works thanks.

blazin 06-03-2003 04:28 PM

Hi Tipsy :)

Assuming your using unux or similiar try this:

mysqldump -u DBUSER DBNAME -p > dbdump.sql


then run your db client and type >

create database NEWDBNAME;

exit the client then do this

mysql -u DBUSER NEWDBNAME -p < dbdump.sql

(of course replacing the italics with your db details)

Hope that helps

Tipsy 06-03-2003 04:32 PM

Quote:

Originally posted by blazin
Hi Tipsy :)

Assuming your using unux or similiar try this:

mysqldump -u DBUSER DBNAME -p > dbdump.sql


then run your db client and type >

create database NEWDBNAME;

exit the client then do this

mysql -u DBUSER NEWDBNAME -p < dbdump.sql

(of course replacing the italics with your db details)

Hope that helps

Thanks blazin - only way I know how to do it. Just wodering if there was a quicker/easier way.

vending_machine 06-03-2003 04:38 PM

Quote:

Originally posted by Tipsy


Thanks blazin - only way I know how to do it. Just wodering if there was a quicker/easier way.

Quote:

mysqladmin -uUSER -pPASSWORD create NEWDATABASE
mysqldump -uUSER -pPASSWORD --no-create-db --quick DATABASE | mysql -uUSER -pPASSWORD NEWDATABASE
Pretty quick and easy.. :)

blazin 06-03-2003 04:40 PM

Quote:

Originally posted by Tipsy


Thanks blazin - only way I know how to do it. Just wodering if there was a quicker/easier way.

No problem.

I always use this method myself....
I think there is a simpler way but without my manual I'm clueless :)

blazin 06-03-2003 04:41 PM

Pure genius Vending Machine :)

I'm taking notes..........


All times are GMT -7. The time now is 10:08 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123