PHP OK, but “Error establishing a data..” on Mac
-
PHP OK but “Error establishing a database connection!” on Mac
I have been trying to install WordPress according to the instructions on the MacZealots page, but with success only to the point of starting WordPress(PowerBook 1GHz, OS X 10.3.6). My intention is to use my own computer as a server.
The MySQL installation went OK. I can get into MySQL with my password (MySQLPassword) and I understand that I am username ‘root’.
When I open the page https://localhost/index.php I get loads of information about PHP 4.3.2.
My wp-config.php file inside my ‘wordpress’ folder (which is in the ‘Documents’ folder of /Library/WebServer includes
// ** MySQL settings ** //
define(‘DB_NAME’, ‘wordpress’); // The name of the database
define(‘DB_USER’, ‘root’); // Your MySQL username
define(‘DB_PASSWORD’, ‘MySQLPassword’); // …and password
define(‘DB_HOST’, ‘localhost’); // 99% chance you won’t need to change this value
…but when I enter
https://localhost/wordpress/wp-admin/install.php
or
https://127.0.0.1/wordpress/wp-admin/install.php
I get the:
‘Error establishing a database connection! This probably means that the connection information in your wp-config.php file is incorrect. Double check it and try again…’
message…
If I open file:///Library/WebServer/Documents/wordpress/wp-admin/install.php (which was linked in one of the help pages) I see pages of text with Step 1,2,and 3, with the last telling me that:
‘What is the web address of your WordPress installation? (We probably guessed it for you correctly.)’
followed by a box with: ‘<?php echo $guessurl; ?>’
My understanding is that my username or password for MySQL somehow don’t suit my wp-config.php file, but I don’t know why.
I’d be grateful for any feedback. Probably the answer is under my nose, but I have trekked around the Web to find it – until now with not much luck.
For your information, I’ll add a couple of provisos:
When I first tried this out, I had modified my httpd.conf file to listen in on port 8008 as my provider had blocked port 80. There was no problem accessing my computer from the web outside. I included:
Listen 8008 and Port 8008
in the relevant places with the same results I have just described. Now I have commented these entries out to give me normal port 80 behaviour, but with no success locally. Strangely, the line:
LoadModule log_forensic_module libexec/httpd/mod_log_forensic.so
is missing from my httpd.conf file, though present in my httpd.conf.default file. I don’t know how this was caused or whether it is important. Everything else looks normal.
In short, I’m pretty confident that I have followed the MacZealot instructions, but from what I have read, there seems to be a problem with my wp-config.php file that I can’t pick. Am I not username ‘root’ in the context of WordPress?
Any thoughts or insight would be most appreciated.
- The topic ‘PHP OK, but “Error establishing a data..” on Mac’ is closed to new replies.