Results 1 to 3 of 3

Thread: mysql connection to second HD

  1. #1
    Join Date
    Mar 2009
    Location
    UK
    Beans
    197
    Distro
    Kubuntu

    mysql connection to second HD

    I'm recovering data from a hard drive where the (kubuntu) o/s crashed. Its attached to another pc at the moment as a 'secondary' HD
    How can I connect to the mysql database on it?
    My intention is to back up the db to the main hd.
    Last edited by bill-lancaster; September 1st, 2013 at 02:30 PM.

  2. #2
    Join Date
    Apr 2012
    Beans
    5,964

    Re: mysql connection to second HD

    I'm not an expert in this area but since it's a weekend and the real db admins might be offline I'll throw my hat in

    If you can boot the old system at all (iirc from your previous thread, it booted OK to the command line - just wouldn't start the KDE GUI?) I strongly advise you to consider doing so, and using mysqldump from the running system while you still can

    https://dev.mysql.com/doc/refman/5.5/en/mysqldump.html

    Although it *should* be possible to rebuild databases from the fileset in /var/lib/mysql it's a lot more complicated - especially if the mysql versions and setups are not exactly the same - see for example

    http://serverfault.com/questions/250...physical-files

    or do a web search for "/var/lib/mysql restore". Hope this helps.

  3. #3
    Join Date
    May 2010
    Beans
    626
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: mysql connection to second HD

    You have two options: Try and chroot and then back it up regularly (using mysqldump or the utility of your choice), or you could copy the /var/lib/mysql folder off of the drive as a replacement for a new install.
    Basic chroot tutorial as follows:
    Code:
    mount -o bind /dev   /<mount point>/dev
    mount -o bind /dev/pts   /<mount point>/dev/pts
    mount -t proc none   /<mount point>/proc
    chroot /<mount point>
    This will give you a command prompt as if you were on the crashed o/s.


    Thanks,
    Cipherboy
    Last edited by cipherboy_loc; September 1st, 2013 at 03:38 PM. Reason: Wrong path.. /var/lib not /var/cache. My bad.

Bookmarks

Posting Permissions

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