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

mysql.sock and my.cnf missing on install (4 replies)

$
0
0
I've installed MySQL on my Mac Pro (v5.1.51 from the .dmg) so that I can develop and test locally with php. Eventually, I will publish the finished php to my website along with (hopfeully) the MySQL database(s) I create.

1) The server is running (System Preferences --> MySQL).
2) I can connect as "root" in Terminal and add a password, create databases (after granting privileges), etc.

The problem comes when I try to open a php page with the following code:

<?php
$con = mysql_connect("server","user","pw");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}

// some code
?>

I get the following error msg:

Can't connect to local MySQL server through socket '/var/mysql/mysql.sock'

I've spent 2-3 hours looking for solutions on the web. mysql.sock doesn't exist on my machine. Nor, for that matter, does etc/my.cnf. And yes, I checked for mysql.sock in /tmp/ rather than /var/.

Any thoughts would be much appreciated.

Randy

Viewing all articles
Browse latest Browse all 7244

Trending Articles



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