MannyNYC

Q: Upgrade to 10.9.2 killed mysql, now i can't get access to database files

I had a mysql 5.6.15 server on my mac in which i had set up numerous tables under a database. 

 

I upgraded to Mavericks a few days ago.  Then I noticed the mysql server was gone.  So I reinstalled it, this time 5.6.17.  I moved my data files (both the frm and ibd files in the datbase folder) to the new mysql install data folder.  I set the permissions through a cdmod command and the new install can see the tables, but can not access the data.  I get an error, "Table does not exist".  It clearly exists and has massive amounts of data in it!

 

I am not too technically savvy - does anyone know how I can access the data in this database?  Is there a way to restore my database?  I need to find a quick way to do this as the data is extremely critical and it's urgent I get access to it - so any help would be much appreciated.

MacBook Air, OS X Mavericks (10.9.2)

Posted on Apr 15, 2014 12:08 PM

Close

Q: Upgrade to 10.9.2 killed mysql, now i can't get access to database files

  • All replies
  • Helpful answers

  • by etresoft,

    etresoft etresoft Apr 15, 2014 12:50 PM in response to MannyNYC
    Level 7 (29,041 points)
    Apr 15, 2014 12:50 PM in response to MannyNYC

    MannyNYC wrote:

     

    the new install can see the tables, but can not access the data.

     

     

    Can you explain this a bit more? Either it does or it doesn't work.

     

    I get an error, "Table does not exist".

     

    It sounds like it doesn't work.

     

    I am not too technically savvy - does anyone know how I can access the data in this database?  Is there a way to restore my database? 

     

    Did you actually restore all of the files? Each database is in its own subdirectory in /usr/local/mysql/data. Don't try copying individual files, copy the entire directory. Preferably, copy the entire data directory.

     

    It is important that you shut down MySQL, copy the data, and then restart MySQL. Don't try to change the data directory while MySQL is running. No good will come from that.

  • by MannyNYC,

    MannyNYC MannyNYC Apr 15, 2014 1:15 PM in response to etresoft
    Level 1 (4 points)
    Apr 15, 2014 1:15 PM in response to etresoft

    I tried copying the entire data folder (stopping the server first) but when i try to start and reconnect i get this: 

     

     

    Unable to connect via the socket, or the request timed out.

     

    Double-check that the socket path is correct and that you have the necessary privileges, and that the server is running.

     

    MySQL said: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

     

     

    So that's why I tried the folder for just the database I want to salvage.  It seems like there is some sort of tablespace issue that I am dealing with.  These .idb files simply can't be transferred from one server to another and since my first server was killed when I installed Mavericks, the reinstall of mysql isn't able to look at the file.

  • by etresoft,

    etresoft etresoft Apr 15, 2014 2:13 PM in response to MannyNYC
    Level 7 (29,041 points)
    Apr 15, 2014 2:13 PM in response to MannyNYC

    OK. I see the problem. See my User Tip on how to setup MySQL. Because you already have MySQL installed, you will have to skip over the bits you don't need to do. You just need to setup the launchd config file and setup /etc/my.cnf.

  • by MannyNYC,Helpful

    MannyNYC MannyNYC Apr 15, 2014 3:03 PM in response to MannyNYC
    Level 1 (4 points)
    Apr 15, 2014 3:03 PM in response to MannyNYC

    Your reply isn't showing yet, but I received the message.

     

    That solution did not appear to work.  Seems there is a more fundamental issue going on.  I can get the server to run if I swap back the new /data folder for the old server /data folder.  Changing them doesn't seem to be a work around.

     

    When I change them, even after going through the guide you gave me and making those edits to the lauch and /etc files....i get the same exact error.  I went through the err log generated and here is what it shows:

     

    2014-04-15 17:54:14 1205 [ERROR] InnoDB: ./ibdata1 can't be opened in read-write mode

    2014-04-15 17:54:14 1205 [ERROR] InnoDB: The system tablespace must be writable!

    2014-04-15 17:54:14 1205 [ERROR] Plugin 'InnoDB' init function returned error.

    2014-04-15 17:54:14 1205 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.

    2014-04-15 17:54:14 1205 [ERROR] Unknown/unsupported storage engine: InnoDB

    2014-04-15 17:54:14 1205 [ERROR] Aborting

  • by MannyNYC,

    MannyNYC MannyNYC Apr 15, 2014 3:12 PM in response to MannyNYC
    Level 1 (4 points)
    Apr 15, 2014 3:12 PM in response to MannyNYC

    I did a chmod -R 777 on the entire directory and that seemed to do the trick!  I can now access my data!

     

    Seemed that was the problem all along.

  • by MannyNYC,Solvedanswer

    MannyNYC MannyNYC Apr 15, 2014 3:13 PM in response to MannyNYC
    Level 1 (4 points)
    Apr 15, 2014 3:13 PM in response to MannyNYC

    I did a chmod -R 777 on the entire directory and that seemed to do the trick!  I can now access my data!

     

    Seemed that was the problem all along.