Jump to content
xisto Community

dzimney

Members
  • Content Count

    3
  • Joined

  • Last visited

  1. Yeah, the problem with all of that though, is that it all used to work fine. There was a point when everything was cool, root with no password, localhost and 127.0.0.1 as the hostname, and everything was gravy. Also, I'm on OS X, and I'm pretty sure that root defaults to a blank password. I think I changed it at one point, and then back to blank (all of this long before the issue arose).
  2. Thank you for the reply. It's an ongoing issue, so it's definitely not too late. At this point, I'm opting for option 3. It's not a big enough issue at this point to do a fresh install of MySQL though. Even still, it is an awfully curious issue and I would like to solve it just for the sack of solving it. In the meantime it works well enough to use 127.0.0.1 for sites in my sandbox. I don't think it's either of the first 2 options you've posted, though I could be wrong. Here's a screenshot of my permissions as provided my phpMyAdmin. Thanks again for the efforts team!
  3. I'm running local sandbox on OS X 10.6. Been doing so for quite sometime. Ran an software update and now everything seems to be jacked up. Here's the basic problem: I'm unable to connect to MySQL using PHP when defining the host as "localhost", which I need in order to keep in sync with the rest of the team. First, the relavant code. Here's my test php script: <?php$usr = "root";$pass = "";$host = $_SERVER['HTTP_HOST'];//connection to the database$dbhandle = mysql_connect($host, $usr, $pass) or die("Unable to connect to MySQL"); echo "Connected to MySQL";?> And here's my httpd-vhosts.conf file: NameVirtualHost *:80<VirtualHost *:80> ServerName localhost DocumentRoot /Users/admin/Development</VirtualHost><VirtualHost *:80> ServerName local DocumentRoot /Users/admin/Development</VirtualHost><VirtualHost *:80> ServerName test DocumentRoot /Users/admin/Development</VirtualHost> So, with this config, navigating to "127.0.0.1", "local" or "test" into my browser, I'm able to connect to MySQL. The test script returns: "Connected to MySQL". But, if I enter in "localhost" the script dies giving me the output: "Unable to connect to MySQL". If I set the hostname to 127.0.0.1 or any VirtualHost ServerName as defined in my httpd-vhosts.conf file, excluding 'localhost', it works. That is to say, in my example PHP script I'm using $_SERVER['HTTP_HOST'] but can also statically set $host to '127.0.0.1', 'local' or 'test' and the script will execute (without error) on all four tests sites (127.0.0.1, localhost, local and test). And of course statically setting $host to 'localhost' fails across all four. Any ideas? Again, I recently ran an update on my machine, which very well could have caused all of these problems. My next step will be to reinstall MySQL. Unfortunately I'm not exactly sure what the updates where. I do know that the issue came about sometime within the past four days as last friday my sandbox was working fine. Thanks in advance!
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.