[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 559
  • Last Modified:

Copy and rename a MySQL database and its information

Im using MySQL Server 4.1 and MySQL Administrator and I want to copy a database and its information and rename it so I can use it for another site. Can anyone tell me how to do this?
0
overcolor
Asked:
overcolor
  • 3
  • 3
1 Solution
 
fcontrepoisCommented:
Use mysqldump to extract the data then create the new db and restore the data.
0
 
dagaz_deCommented:
U can use a .bat File if you eter something like this.
Please modify the Mapped D:\ and replace the placeholders (YOUR_...) to your needs.

C:\YOUR_FOLDER_WHERE_MYSQL_IS\bin\mysqldump -u YOUR_USER --password=YOUR_PASSWORD YOUR_DB YOUR_TABLE  | mysql -u YOUR_USER --password=YOUR_PASSWORD YOUR_DB YOUR_NEW_TABLE_NAME

you can use this command also in your mysqladmin or the console window
0
 
overcolorAuthor Commented:
@dagaz_de
what if the directory where the mysqldump is has spaces

C:\Program Files (x86)\MySQL\MySQL Server 4.1\bin\mysqldump
??
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
fcontrepoisCommented:
Use "
0
 
overcolorAuthor Commented:
fcontrepois

Im sorry I don't understand what you are saying?
0
 
fcontrepoisCommented:
Use "c:\program files\...\mysqldump.exe" --all-databases

For example
0
 
overcolorAuthor Commented:
This is what Im using, is this correct?

"C:\Program Files (x86)\MySQL\MySQL Server 4.1\bin\mysqldump.exe" -u root --password=password dataold  | mysql -u root --password=password datanew
0

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now