Installing mySQl on Mac OS X

S

sealey

Guest
Hi, I wonder if anyone can be of assistance. I am doing a few web projects at the moment in PHP using mySQL as a back end but it's so time consuming to keep FTPing the files up to my ISP to test every change.

So I decided to install PHP and mySQL on my Mac running Mac OS X 10.3. Installation of PHP went very smoothly and is running fine with the Apache installation that came with Mac OS X. However I am really struggling to get mySQL up and running. DOwnlaoded it from the mySQL site and run the install and followed the instructions as best I could but I have no idea how to link it in with PHP and have no idea to test if it's installed okay or check if it's running. Can someone please offer me some simple step by step instructions?

Thanks in advance,

Richard Seale
 
OP
D

dziner

Guest
I recommend Marc Liyanage's site:

entropy.ch

There seems to be a lot of info there. Like you, I have tried to install php and mysql so that I can build dynamic sites locally. BUT, I got into a mess of stuff and I don't think mysql is installed properly... so I kinda gave up. Until I rebuild my system and start over again.
 
Joined
Jun 11, 2003
Messages
4,915
Reaction score
68
Points
48
Location
Mount Vernon, WA
Your Mac's Specs
MacBook Pro 2.6 GHz Core 2 Duo 4GB RAM OS 10.5.2
Install phpMyAdmin that will help you figure out if it is running or not.
 
OP
N

nr-media

Guest
Ping port 3306, should get a response if mySql is up.

I use the Navicat client to access mySql.
 
OP
H

h0tk4rl

Guest
You don't need to link mysql to php. It's more of a loading php modules in your apache config file. To see if MySQL is functional, from a terminal window,

cd /usr/local/mysql/bin
./mysql

If the server is running you should get this:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 60 to server version: 4.0.20-standard

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>

If not, you should get something like this

ERROR 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

To make sure your php is configured properly, create a test.php file with the following in it:
<?php

phpinfo()

?>

If when you load http://localhost/test.php you see your php configs then you properly set up the module in apache.

Finally get a copy of phpmyadmin. Once you copy that to your site directory you only have to add the phpmyadmin home directory to the config file and if everything is configured, you'll have access to your database.
 
OP
A

aXid

Guest
If all you need is to test your projects, I highly recommend using MAMP (Macintosh, Apache, MySQL, PHP). It has worked fine for me and installing it is a breeze.

Note: By default, you need to specify port when connecting to mysql or localhost:
PHP:
$link = mysql_connect( "127.0.0.1:8889", "root", "root" );
Code:
http://localhost:8888/

Good luck
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top