Hi-
I am installing PHP and MySQL for the first time on MAC OSX 10.1.5.
The PHP install seems to be fine. But the mySQL install is whacked. I first installed PHP 4 as an admin "jeffnye" and created a user "mysql" in the users control panel. Then tried to install mySQL while logged in as admin "jeffnye" as before, but the install only seemed to partially install.
I am new to UNIX and OSX, and I was told that maybe I should install things as root, so a friend helped me uninstall the previous mySQL install, and as root installed mySQL. While logged in as root he could make successful calls to mySQL from the terminal window, but not when logged in as jeffnye or mysql (both admin level users). When I try to create a DB connection via the following script:
<HTML>
<HEAD>
<TITLE>Creating a Database</TITLE>
</HEAD>
<BODY>
<?php
// Set the variables for the database access:
$Host = "localhost";
$User = "user";
$Password = "password";
$DBName = "NewDatabase3";
$Link = mysql_connect ($Host, $User, $Password);
if (mysql_create_db ($DBName, $Link)) {
print ("The database, $DBName, was successfully created!<BR>\n");
} else {
print ("The database, $DBName, could not be created!<BR>\n");
}
mysql_close ($Link);
?>
</BODY>
</HTML>
.... I get the following error:
Warning: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /Library/WebServer/Documents/script_11_1.php on line 8
Warning: MySQL Connection Failed: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /Library/WebServer/Documents/script_11_1.php on line 8
Warning: Supplied argument is not a valid MySQL-Link resource in /Library/WebServer/Documents/script_11_1.php on line 8
The database, NewDatabase3, could not be created!
Warning: Supplied argument is not a valid MySQL-Link resource in /Library/WebServer/Documents/script_11_1.php on line 10
SO - How do I get my permissions all set so I can start making some simple PHP pages using mySQL on my OSX development machine? Does my problem lie in the instalation or creation of users? Any help would be appreciated.
Thank you!
Jeff Nye
jeff@jeffnye.com
System Info
Operating System: Mac OS (OSX 10.1.5)
Computer Make: Apple (Powerbook G3 firewire)
Processor: 500 MHz G3
Web Browser: IE 5.1.4
Other Information:
mySQL3.23.51
PHP 4.0