0

I received a bunch of these types of files and haven't a clue as how to restore the database on my Mac. I've found instructions on how to do this on Windows, that you simply need to put these into a specific directory and the database should be restored, but I don't know which directory, or even where it would be located in OS X.

Any help would be greatly appreciated!

oliverkiss.com
  • 47
  • 1
  • 10

1 Answers1

0

To find you MySQL data directory, open the file /etc/my.cnf. It should be there if you've MySQL installed.

Find the variable datadir: datadir=/var/lib/mysql, create a directory under that and copy all your DB files in there, as in /var/lib/mysql/database, where database is your DB name.

In a previous version of this answer I suggested to use sudo locate user.frm, but it didn't work, even after running sudo /usr/libexec/locate.updatedb. If anyone knows why, I'd like to hear.

stivlo
  • 83,644
  • 31
  • 142
  • 199
  • I ran the command in Terminal, and I got this message: WARNING: The locate database (/var/db/locate.database) does not exist. To create the database, run the following command: sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist I ran that command as well, it prompted me for my password, then ran the locate command again, and I received the same message. Help! – oliverkiss.com Oct 21 '11 at 02:14
  • I'm more a Linux user, but I have a OSX Leopard virtual machine... in fact it doesn't work, even prepending `sudo`. I don't know why, it should. I am going to delete this answer, because obviously is not correct, I'm also curious to know the solution, will stay tuned. – stivlo Oct 21 '11 at 02:25
  • I found the my.cnf file, but it is empty. I also noticed that I had 2 mysql folders in usr/local/. I've uploaded a screen shot of the directory, as well as the opened cnf file at http://oliverkiss.com/images/temp/mysql_1.png – oliverkiss.com Oct 21 '11 at 03:00
  • Let me add a huge thank you stivlo for taking the time to help me out on this one! – oliverkiss.com Oct 21 '11 at 03:02
  • I opened up Sequel Pro (a MySQL client in case you're not familiar with the application) and it successfully connects to the local MySQL database. Screen shot at http://oliverkiss.com/images/temp/mysql_2.png – oliverkiss.com Oct 21 '11 at 03:08