Solved

Copy and rename a MySQL database and its information

Posted on 2011-03-24
7
548 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
What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

 
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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…

688 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