Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Where and how does MySQL save databases?

Status
Not open for further replies.

kyru

Programmer
Jan 17, 2009
45
ES
This may look as a very lame question, but I mean, if I create a database with MySQL it seems to be nowhere. In fact I've searched the hard disk using the name I've given to the database and nothing appears. To make my application work on another computer I could save the database info into a text file and then I could create the database in the other computer via INSERT commands, but this is just lame.

I'm using MySQl 5.1.30 in case that helps.
 
Well that depends on the OS you installed it.

On Windows for instance, MYSQL has a Data folder inside the installation directory, and inside that folder, it has folders named after each of your databases.

Inside are the files for the tables.








----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Yeah, it's supposed to be on a /data in MySQL folder but I don't have it. I just have /bin /Doc and /share directories.
This is a pretty weird problem...
 
Well I finally found the answer. It was putting the databases into a hidden directory so I couldnt find it. If someone else has this problem the directory can be checked by looking into the my.ini file and checking the element datadir.

Thanks for your hel Vacunita.
 
Just out of interest what operatng system are you on ?
 
I run 5.0.51b under XP and that doesn't hide the data dir. Odd - they must have changed it for some reason ! - any how thanks for the steer.
 
Can someone tell me where OS X Leopard stores the databases?
 
When you are in mysql client run this at the command line:

Code:
SHOW VARIABLES LIKE 'datadir'

and that will tell you where the mysql data directory is. Note that will work for any OS.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top