Results 1 to 3 of 3
  1. #1
    Join Date
    May 2003
    Melbourne, Australia

    How to restore mysql databases from /var/lib/mysql/user_database/ files only?

    as the title asks. I recently had a harddrive failure and luckliy I can still access certain directories on this failed drive. I can still access the /var/lib/mysql/ directory which holds all the users databases and have backed all these up separately using tar.

    Now what I need to know is how do you restore these database files to another server? I tried simply untar'ing one of these to the new servers /var/lib/mysql/ direcotry and it stuffed Mysql up - it went offline. I had to get a cpanel tech to bring Mysql back online.

    So how can I get these database files to fully work on a new server? Please any help would be greatly appreciated. Australia & USA Hosting - cPanel, WHM, VPS
    Software - WHMreseller - WHMexec - KVZcloud
    Host Repo - The Linux Web Host Knowledge Repository - Host Search Australia

  2. #2
    Do a fresh MySQL installation on a server. Delete /var/lib/mysql folder. Now copy /var/lib/mysql folder old folder to new installation. Start mysql, it will work.

    I have done this few times, yesterday also i have done this for moving MySQL 4.x on FreeBSD 5.4 to MySQL 5.x on CentOS, it worked with out any problem.

  3. #3
    Join Date
    Oct 2004
    Kerala, India
    You can make the databases up by copying the db directory to /var/lib/mysql/. However the privileges for the db users to db should be set manually.
    David |
    Affordable Server Management Solutions sales AT cliffsupport DOT com
    CliffWebManager | Access WHM from iPhone and Android

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts