Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where does Leopard Server's MySQL store its data?

I'm trying to recover a table in a MySQL database from Time Machine, however I don't know and can't find where Leopard Server's MySQL stores its data files.

  1. Does anyone know where they are stored?
  2. Is there an easy way to run mysqldump on them without restoring them?
  3. Is there anything else I should know about Time Machine and MySQL data file(s)?
like image 292
pixelcort Avatar asked Jan 15 '09 19:01

pixelcort


People also ask

Where does MySQL store its data?

Introduction. Typically, MySQL will store data in the default directory of /var/lib/mysql.

Is MySQL database stored locally?

Sure. But where it is depends on the package you have chosen to install MySQL. Have a look at this SO answer for different options. /usr/local/mysql/ and /usr/local/var/mysql/ are usual locations.

Where does MySQL store databases on Mac?

By default, the MySQL directories are installed under /usr/local/ . Even better, add /usr/local/mysql/bin to your PATH environment variable. You can do this by modifying the appropriate startup file for your shell.

Where does MySQL 8.0 store databases?

The default data directory location is C:\Program Files\MySQL\MySQL Server 8.0\data , or C:\ProgramData\Mysql on Windows 7 and Windows Server 2008. The C:\ProgramData directory is hidden by default. You need to change your folder options to see the directory and contents.


2 Answers

Connect to the database and issue

SHOW VARIABLES LIKE 'datadir';

Which will tell you the right answer even if it's been changed from the default.

like image 140
MarkR Avatar answered Nov 02 '22 18:11

MarkR


For my standard install (from a package) it was located in

/usr/local/mysql/data
like image 43
nevan king Avatar answered Nov 02 '22 17:11

nevan king