Solved

MOVE/COPY entire MySQL database

Posted on 2008-10-02
5
915 Views
Last Modified: 2008-11-07
Is there a way to move or copy an entire database, rather than just a table?
This would be across Cpanel hosting accounts, i have root access and MySQL access enabled.
I have myphpadmin and phpflashmyadmin

In myphpadmin, there's a database copy (structure+data) but i don't see how to copy it to another account.
For instance in the text field entry for    Copy database to:
i would want to put     newusername_dbname
but i get access denied.  So that means i need to login somehow as root.
I can login as root in phpflashmyadmin(there's no copy database option), but i don't know how to login as root  in phpmyadmin  since it's launched from a given cpanel hosting account

i may just need to export and  then import in the new account.
just seeing if there's a shortcut

thanks
0
Comment
Question by:willsherwood
[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
  • 2
5 Comments
 
LVL 7

Accepted Solution

by:
mattaob earned 500 total points
ID: 22623694
You can use mysqldump from the command line

mysqldump -u username -ppassword -h source_server_ip   database_name  >   outputfile.sql

That will dump the database to a file

then
create the database in the mysql target server  

mysql -u username -ppassword -h target_server_ip  database_name <   outputfile.sql

0
 

Author Comment

by:willsherwood
ID: 22623739
i understand that that involves the strategy of exporting,  i was hoping there was a
copy-database    strategy available.
0
 
LVL 7

Expert Comment

by:mattaob
ID: 22623971
The mysqldump was is essentially making a backup of the database then restoring it to another server.
It's the way I prefer to do it as I've never lost any data doing it that way.
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

More Fun with XML and MySQL – Parsing Delimited String with a Single SQL Statement Are you ready for another of my SQL tidbits?  Hopefully so, as in this adventure, I will be covering a topic that comes up a lot which is parsing a comma (or other…
This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

733 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