Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
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.
Heare iam taking mysqldump backup in my server and i can any one help me how to take mysql physical backup and is copying /var/lib/mysql a good alterntive to mysqldump?
I have stopped mysql service and i have taken backup /var/lib/mysql using tar and in another server i have installed mysql and i replcaed the backup to /var/lib/mysql and i started mysql service and i was not able to access the database,can u please assist me
mysqldump or realtime replication and mysqldump are the best and most reliable methods of backup up databases, especially if they have multiple or mixed table engines such as innodb/myisam/memory. These are the prefered methods of backup up MySQL databases.
IF you have a database where you KNOW that the only storage engine is MyISAM then with shutting down the whole MySQL server process and copying the relevant folder then you can take the kind of backup you need.
If you simply shut down and copy the whole /var/lib/mysql "tree" and then drop it on to a different server then it may or may not work (as you've already discovered).
The databases I'm backup up with mysqldump consist of millions of rows and are used to transact millions of dollars of business each month, so I'm not playing with a database of some 100 post WordPress sites. I use this method because it works simply, is reliable, and gives consistent results without having to stop the database server. It's also highly suited to scripting backups for different databases (See the script examples in the other threads for details).
If you wish to go down the stop server/copy files route then good luck with that.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.