Where is the sql file store in & Where can I find php.ini on Mac osx client

In windows xp i can find the sql file in side the folder of MySQL and I can find php.ini in the C directory under the php's folder but in mac os Icannot find it could anyone tell me where it is and how can I find thanks.

Mac OS X (10.4.8)

Posted on Jan 11, 2007 9:36 AM

Reply
11 replies

Jan 11, 2007 10:20 AM in response to sthapaun

What SQL file are you looking for?

There is no one 'sqlfile', so it's not clear what you're looking for.

As for php.ini, there isn't one. It's only needed when you change PHP from the defaults. If you want to override those defaults you can create a file at /etc/php.ini with the appropriate directives. Alternatively, you can copy /etc/php.ini.defaults to /etc/php.ini which will give you a list of the defaults which you can uncomment and edit.

Jan 11, 2007 12:54 PM in response to Camelot

Thanks for your answer about php config I'll try what you had sugessted and I think that will solves my problem

About MySQL file I mean , when I creat Database from phpmyadmin in windows for example if I create Schema name 'myfile' and table name 'firstfile' it will create 'firstfile.sql' in C:/Appserve/SQL/Data/myfile
so if I want to import or remove another table, all I need to do is only drop another file.sql in to those directory
So in mac osx dose it has the directory /SQL/Data/ for me to import and Export Database easily

Jan 11, 2007 9:11 PM in response to sthapaun

Hi--

so if I want to import or remove another table, all I
need to do is only drop another file.sql in to those
directory
So in mac osx dose it has the directory /SQL/Data/
for me to import and Export Database easily


I don't know about later versions of MySQL, but if you use the installer from MySQL' site, up to the 4.1.x versions, the data is in /usr/local/mysql/data. Because of permissions, it's difficult to do much poking around in there. You'll probably need to be the root user to look in there.

Also, I think it depends on the type of table you had MySQL create, but the date is actually stored in directories inside there. So, for example, I have a database called "zipcodesdb". So I have a directory here: /usr/local/mysql/data/zipcodesdb and the contents look like this:

<pre class="command">-rw-rw---- 1 mysql wheel 65 Nov 7 20:52 db.opt
-rw-rw---- 1 mysql wheel 4219644 Nov 7 20:52 zipcodes.MYD
-rw-rw---- 1 mysql wheel 1409024 Nov 7 20:52 zipcodes.MYI
-rw-rw---- 1 mysql wheel 8888 Nov 7 20:52 zipcodes.frm</pre>But, unless you have a specific reason to copy the database files around, I'd suggest looking at mysqldump. It's great for backup, and can be really handy for moving and copying databases between machines, especially if the two machines have different MySQL versions.

charlie

Jan 12, 2007 9:16 AM in response to Charles Minow

Could you please tell me how can I access to /usr/local/mysql/data/

I don't know where the /usr/local/

Did you mean /Macintosh HD/Users/(My home Folder)/ if so I cannot find the folder mysql If I misunderstood could you please tell me the directory from

/Macintosh HD/../../-../usr/local/mysql/
and
/Macintosh HD/../../-../../../ect/ (for php.ini)
Thank You

Jan 12, 2007 11:11 AM in response to sthapaun

Could you please tell me how can I access to /usr/local/mysql/data/

The path is: /usr/local/mysql/data

You can't normally access this directory from the Finder since it's hidden and not normally available to regular users. However if you use the Finder's Go -> Go to Folder option you can enter that path and go there.

The permissions on the directory, though, will likely preclude you from doing anything. Changes to this directory are usually either managed through the terminal.

Jan 13, 2007 8:33 AM in response to Niel

apples-Computer:/usr/local/mysql apple$ cd data
-bash: cd: data: Permission denied
apples-Computer:/usr/local/mysql apple$ sudo sh
Password:
apples-Computer:/usr/local/mysql apple$ cd data
-bash: cd: data: Permission denied
apples-Computer:/usr/local/mysql apple$ cd data
-bash: cd: data: Permission denied
apples-Computer:/usr/local/mysql apple$ chmod +rw data
chmod: data: Operation not permitted

I'd like to set the folder /mysql/data to except me for coppy database folder
How can I get the permittion to access the /mysql/data folder

Jan 13, 2007 9:55 AM in response to sthapaun

Hi--

apples-Computer:/usr/local/mysql apple$ cd data
-bash: cd: data: Permission denied
apples-Computer:/usr/local/mysql apple$ sudo sh
Password:
apples-Computer:/usr/local/mysql apple$ cd data
-bash: cd: data: Permission denied
apples-Computer:/usr/local/mysql apple$ cd data
-bash: cd: data: Permission denied
apples-Computer:/usr/local/mysql apple$ chmod +rw
data
chmod: data: Operation not permitted


It looks to me like you haven't gained root access in the examples above. If you follow Niel's example:

<pre class="command">sudo sh</pre>you should get a different prompt when you actually are the root user:

<pre class="command">sh-2.05b#</pre>because you'd be changing shells from bash to sh.

I'd like to set the folder /mysql/data to except me
for coppy database folder
How can I get the permittion to access the
/mysql/data folder


You should be able to do anything to those files without changing permissions if you're the root user.

But, just for your information, I never directly move the database files. If I want to move a database between computers, I always use the mysqldump command and redirect it to a file:

<pre class="command">/usr/local/mysql/bin/mysqldump --add-drop-table -u username -p db_name > /path/to/output/file.sql</pre>That makes a single text file with all the SQL commands necessary to build your database tables and populate them with your data. If you want to restrict it to just one table from a database, you can add the table name after the db_name:

<pre class="command">/usr/local/mysql/bin/mysqldump --add-drop-table -u username -p db_name table_name > /path/to/output/file.sql</pre>To import that file into another machine, you have to create the database first, which you could do with phpAdmin. Then, just import the tables and data like this:

<pre class="command">/usr/local/mysql/bin/mysql -u root -p db_name < /path/to/output/file.sql</pre>That'll create all your tables and populate them with your data.

If you copy your databases this way, you're much less likely to run into trouble with compatibility issues if you're moving between machines with different versions of MySQL.

charlie

Jan 13, 2007 9:57 AM in response to sthapaun

Run the following in the Terminal:

sudo chmod a+rwx /usr/local/mysql/data/

Alternatively, you can use the Go to Folder command in the Finder's Go menu to navigate to /usr/local/mysql/. Drag the data folder to another location, click the Authenticate button in the dialog which appears, and type in your password. This will need to be done again each time you want to copy it.

(19120)

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Where is the sql file store in & Where can I find php.ini on Mac osx client

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.