?
Solved

MOVE/COPY entire MySQL database

Posted on 2008-10-02
5
Medium Priority
?
918 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 2000 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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

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…
Containers like Docker and Rocket are getting more popular every day. In my conversations with customers, they consistently ask what containers are and how they can use them in their environment. If you’re as curious as most people, read on. . .
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

765 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