Newsroom Update

Beginning in May, a special Today at Apple series titled “Made for Business” will offer small business owners and entrepreneurs free opportunities to learn how Apple products and services can support their growth and success. Learn more >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Where is Mysql?

Hello,
I have a powerbook G4 with operating system MACOSX Tiger (Version 10.4.5).
Apache is already default in the system; I also activated php, already present in the system, following some instructions found on the Internet to modify file config.php of Apache and everything was ok....the last problem: Mysql!!
The phpinfo() page tells me I have MySQL v4.1.13a as follows:
enabled
Active Persistent Links 0
Active Links 0
Client API version 4.1.13a
MYSQL MODULETYPE external
MYSQL_SOCKET /var/mysql/mysql.sock
MYSQL_INCLUDE -I/usr/include/mysql
MYSQL_LIBS -L/usr/lib/mysql -lmysqlclient
My problem is that php thinks I have Mysql installed but I can't find it. I have looked for it in all folders visible or hidden in the system (spending hours..)but I can find nothing of mysql(while I have easily found the folder of php).
I tried to bypass the problem making a script in php to create a trial database
<?php
$db=mysql_connect("localhost", "", "");
$database = 'devtest';
$istruzione= mysql createdb( $database, $db);
mysql_query($istruzione);
?>
When I open browser and I dial: localhost/proveweb/create_db.php
it appears:
Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2) in /Library/WebServer/Documents/proveweb/create_db.php on line 10
Fatal error: Call to undefined function: mysql createdb() in/Library/WebServer/Documents/proveweb/create_db.php on line 12
Is there an error with script or isn't Mysql there?
Can anybody help me to solve this problem?
Thank you for any suggestions
santinac

powerbook G4, Mac OS X (10.4.5)

Posted on Jun 8, 2006 8:49 AM

Reply
3 replies

Jun 8, 2006 9:07 AM in response to santinac

Sounds like you're running just standard Mac OS X (not OS X Server).

MySQL is not installed by default on Mac OS X (it is preinstalled on OS X Server, located at /usr/bin/mysql, use /Applications/MySQL Manager.app to start it).

You'll have to install MySQL yourself. Download a package from MySQL's site.

The package from MySQL's site will, if I recall, put the socket file in /tmp, so you'll need to change your php.ini file so that it looks for the MySQL socket in /tmp/mysql.sock.

After that, you should be fine.

Jun 9, 2006 11:20 AM in response to santinac

Basically, because support as a MySQL client was compiled into PHP when it was built and installed. It is completely different from having MySQL server installed on your machine.

With that version of PHP, you could use a MySQL server located on any machine (as long as you had permission). PHP doesn't care where the MySQL server is located. If you want one locally, you just have to install it.

Where is Mysql?

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