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?
overcolorAsked:
Who is Participating?
 
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
 
Frank ContrepoisVP Technical SalesCommented:
Use mysqldump to extract the data then create the new db and restore the data.
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
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

 
Frank ContrepoisVP Technical SalesCommented:
Use "
0
 
overcolorAuthor Commented:
fcontrepois

Im sorry I don't understand what you are saying?
0
 
Frank ContrepoisVP Technical SalesCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.