Where is the 'data' folder of MySQL ?

UnPluGs

Registered
Good day..

I'm newbie in web developing using apache+php+mySQL in MacOSX platform.
Before this, I used to develop web application using apache+php+mySQL in windows platform.

May I know where is the location of 'Data' folder of MySQL in MacOSX? In Windows, it is located in C://MySQL/Data

The reason I wan to know the location is because I want to move my database from windows to MacOSX, so that I don't need to create the database again. I tried to search... but I can't find the path.

Really urgently need your help. Thanks a lot.

:)
 
I think it's /usr/loca/mysql/data, but since I don't have MySQL installed at the moment, I can't double-check that.

Of course if you use Fink to install it, it will be under the /sw tree.

To search for it, use the unix find command, rather than using the GUI Find (which doesn't search "hidden" directories like /usr by default)

Wade
 
Dear Wade,

I search dy... searched nothing. :(

Where I should put the database folder (Project database, which is in Windows C://MySQL/Data folder) in MacOSX ?

Sorry.... I'm really a newbie in MacOSX.
 
I type 'cd /usr/local/mysql/data'
then it gave me "Permission denied"..... Whats wroing with this? Anyone can help?
:(
 
another issue, when I type "drop database 'databasename'", it comes out this message:
Error 1010: Error dropping database (can't rmdir './v/', errno: 17)

Anyone can help me... ? Thanks....
 
UnPluGs said:
I type 'cd /usr/local/mysql/data'
then it gave me "Permission denied"..... Whats wroing with this? Anyone can help?
:(

i did have the same problem ... in Windows, the folder is open for public but in Mac, they protect it... ok, this is how to solve:

first, you go to that folder simply from Finder (from Go menu), then right click the "data" folder and choose Get Info
in the ownership & permissions, the default is mysql, you change it to your user name but dont close the Get Info window.

next, there;ll be some database names' folder, right cliick on the database name you want then choose Get Info, change the user permission to your name again. after that, you can see the contents :D

after you finish modifying the folder, you have to change back the permission reversely ( the folder "data" should be the last) .. remember..
unless, i don;t know , when i did this mistake, i couldn;t fix it until i reinstall the mysql

well, hope this will help you :)
 
for the 2nd issue, i think rmdir can;t delete directory if it has contents, may be rm -f can .. but i;m not sure.. another think, i could happen because of the permission problem too...
 
Back
Top