Welcome Guest, Not a member yet? Register   Sign In
mysql sock error using code igniter
#1

[eluser]kingconnections[/eluser]
I am moving this a site over for a client and it uses codeigniter. I am a complete noob to this framework. I got everything copied over and all. I changed the database info in the database.php file. But I get this mysql can not connect to socket error.

Can't connect to local MySQL server through socket '/usr/local/mysql-5.0/data/mysql.sock' (2)


If I use the standard coding skills I am able to connect to the db fine. ie


$conn = mysql_connect('host.sever.net','user1','User1');
if (!conn) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';

if (!mysql_select_db("test")) {
echo "Unable to select mydbname: " . mysql_error();
exit;
}

$sql = "SELECT email
FROM user
";

$result = mysql_query($sql);

if (!$result) {
echo "Could not successfully run query ($sql) from DB: " . mysql_error();
exit;
}

if (mysql_num_rows($result) == 0) {
echo "No rows found, nothing to print so am exiting";
exit;
}

// While a row of data exists, put that row in $row as an associative array
// Note: If you're expecting just one row, no need to use a loop
// Note: If you put extract($row); inside the following loop, you'll
// then create $userid, $fullname, and $userstatus
while ($row = mysql_fetch_assoc($result)) {
echo $row["email"];
echo "<br>";
}

mysql_free_result($result);


mysql_close($conn);

Any ideas? Any help would be great!!!


Messages In This Thread
mysql sock error using code igniter - by El Forum - 11-03-2007, 10:58 PM
mysql sock error using code igniter - by El Forum - 11-04-2007, 01:14 AM
mysql sock error using code igniter - by El Forum - 11-04-2007, 01:22 PM
mysql sock error using code igniter - by El Forum - 11-04-2007, 02:25 PM
mysql sock error using code igniter - by El Forum - 11-04-2007, 06:11 PM
mysql sock error using code igniter - by El Forum - 11-04-2007, 06:56 PM
mysql sock error using code igniter - by El Forum - 11-04-2007, 11:57 PM
mysql sock error using code igniter - by El Forum - 11-05-2007, 12:12 AM
mysql sock error using code igniter - by El Forum - 11-05-2007, 12:15 AM
mysql sock error using code igniter - by El Forum - 11-05-2007, 01:11 AM
mysql sock error using code igniter - by El Forum - 11-05-2007, 03:01 AM
mysql sock error using code igniter - by El Forum - 11-05-2007, 03:30 AM
mysql sock error using code igniter - by El Forum - 11-05-2007, 08:51 AM
mysql sock error using code igniter - by El Forum - 11-05-2007, 10:09 AM
mysql sock error using code igniter - by El Forum - 11-05-2007, 03:53 PM
mysql sock error using code igniter - by El Forum - 11-05-2007, 03:54 PM
mysql sock error using code igniter - by El Forum - 11-05-2007, 08:33 PM
mysql sock error using code igniter - by El Forum - 11-05-2007, 10:40 PM
mysql sock error using code igniter - by El Forum - 11-05-2007, 11:03 PM



Theme © iAndrew 2016 - Forum software by © MyBB