NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.
Forum Discussion
egeek
Oct 17, 2011Aspirant
Wordpress - Error establishing a database connection
Hi guys, I have been trying to get wordpress up and running for about a day. I followed the wordpress guide exactly, then found i needed to provide an updated PHP, which i obtained from ReadyNas...
egeek
Oct 17, 2011Aspirant
I found a little PHP test code to test PHP's connection to MySQL.
It output "connection failed" in the browser window
EDIT: I changed 'localhost' to 127.0.0.1 and to the IP address of the NAS. Still did not work. I assume doing this in the test file reproduces the same conditions the wp-config.php and the results seem to be the same.
EDIT2: I tried a new test code from php.net
This out outputted (via mysql_error() i assume) an interesting bit of dialogue
"Could not fracking connect: No such file or directory" (ignore my insertion of "fracking", i was just doing this to delineate from the other test file ;))
EDIT3:
Tried this, also from php.net
Interestingly, this one connects. It initially refused because i had changed the MySQL password to OLD_PASSWORD type during troubleshooting. I changed it back and BooYah!
So i think i am getting closer, but I still can't get install.php to run for wordpress.
<?php
$db = @mysql_connect('localhost', 'geekmason', 'XXXXXXX');
if (!$db) echo "connection failed";
else echo "connection succeeded";
?>
It output "connection failed" in the browser window
EDIT: I changed 'localhost' to 127.0.0.1 and to the IP address of the NAS. Still did not work. I assume doing this in the test file reproduces the same conditions the wp-config.php and the results seem to be the same.
EDIT2: I tried a new test code from php.net
<?php
$link = mysql_connect('localhost', 'geekmason', 'XXXXXXXX');
if (!$link) {
die('Could not fracking connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);
?>
This out outputted (via mysql_error() i assume) an interesting bit of dialogue
"Could not fracking connect: No such file or directory" (ignore my insertion of "fracking", i was just doing this to delineate from the other test file ;))
EDIT3:
Tried this, also from php.net
<?php
// we connect to localhost and socket e.g. /tmp/mysql.sock
// variant 1: omit localhost
$link = mysql_connect('localhost:/var/run/mysqld/mysqld.sock', 'geekmason', 'XXXXXXXX');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);
?>
Interestingly, this one connects. It initially refused because i had changed the MySQL password to OLD_PASSWORD type during troubleshooting. I changed it back and BooYah!
So i think i am getting closer, but I still can't get install.php to run for wordpress.
Related Content
NETGEAR Academy
Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology!
Join Us!