Solved

Copy and rename a MySQL database and its information

Posted on 2011-03-24
7
545 Views
Last Modified: 2012-05-11
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
Comment
Question by:overcolor
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 9

Expert Comment

by:fcontrepois
ID: 35213118
Use mysqldump to extract the data then create the new db and restore the data.
0
 
LVL 3

Accepted Solution

by:
dagaz_de earned 500 total points
ID: 35214223
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
 

Author Comment

by:overcolor
ID: 35218940
@dagaz_de
what if the directory where the mysqldump is has spaces

C:\Program Files (x86)\MySQL\MySQL Server 4.1\bin\mysqldump
??
0
Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

 
LVL 9

Expert Comment

by:fcontrepois
ID: 35219758
Use "
0
 

Author Comment

by:overcolor
ID: 35220108
fcontrepois

Im sorry I don't understand what you are saying?
0
 
LVL 9

Expert Comment

by:fcontrepois
ID: 35220898
Use "c:\program files\...\mysqldump.exe" --all-databases

For example
0
 

Author Comment

by:overcolor
ID: 35221532
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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes databases have MILLIONS of records and we need a way to quickly query that table to return the results me need. Sure you could use CFQUERY but it takes too long when there are millions of records. That is why SOLR was invented. Please …
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

742 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question