How to copy mysql db's from hardisk to new server?
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How to copy mysql db's from hardisk to new server?
My server was cracked and left in a non bootable state. I've built a new server w/ a fresh install and have mounted the old hard disk so that I can recover data.
I'm trying to get the old databases (/var/lib/mysql) and somehow move or import them into the new mysql server. Any of the advice that I've found so far has not worked because it all requires the old server to be running (hotcopy, mysqldump, etc, etc).
Does anyone have any suggestions for moving the databases as they exist in the old filesystem and importing them into the new server?
OK, managed to solve it. In case anyone else runs into it, simply shutdown mysql and delete all directories in /var/lib/mysql. There should only be two: mysql and test. Then copy over all of the directories from the same location on the old harddrive--make sure that you retain earlier permissions (cp -rp). Restart mysql and run some queryies to see if you're back up and running.
I thought mysqldump required a running server? I'll confess to not RingTFM, I just assumed that the old server would have still needed to be running for mysqldump to work.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.