Quantcast
Channel: MySQL Forums - Install & Repo
Viewing all articles
Browse latest Browse all 7239

Problem with MySQL Installation On Mac (no replies)

$
0
0
I'm using Mac OS 10.6.4. I have installed MySQL. I can access it via the Terminal and do all the normal things, create databases, create tables, etc. It all works just as I would expect it to.

But, when I try to connect via a web script it won't connect.

I created a very simple little php script to test the connection:

<?php

echo mysql_connect ('localhost', 'root', 'mypassword');

?>

When I load this page I get the following error:

Warning: mysql_connect() [function.mysql-connect]: [2002] No such file or directory (trying to connect via unix:///var/mysql/mysql.sock) in /Users/stevewilkison/Sites/connect.php on line 3

Warning: mysql_connect() [function.mysql-connect]: No such file or directory in /Users/stevewilkison/Sites/connect.php on line 3

I don't understand why I am able to access the MySQL via the Terminal but not via a php script. I'm using the same user (root) and password in the Terminal that I'm using in the php script. I've done this before and never had any problems.

Any help would be greatly appreciated, as this is driving me crazy!

Thanks very much.

Viewing all articles
Browse latest Browse all 7239

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>