Sunday, January 23, 2011

Where does MySQL store its database files on OS X?

As I would like to move those files from one server to another server, while the database is offline.

  • I don't have access to my Mac right now, so can't say for certain. Why not simply search (from Terminal, not Spotlight) the file system for "mysql", as there will always be a table named mysql.

  • It should be stored in: /usr/local/mysql/data

    From tegbains
  • Look for the my.cnf file - should be in the /etc/ directory and then look for a line like:

    datadir=/var/lib/mysql

    The datadir is where mysql stores all the database files.

    Autobyte

    From Autobyte
  • OS X Server (at least v10.6) keeps the database in /var/mysql by default. You can change this in Server Admin -> MySQL service -> Settings -> Database location (note that editing this field doesn't actually move the data, just changes where it's loaded from).

0 comments:

Post a Comment