// ** MySQL settings ** //
define('DB_NAME', 'newdb'); // The name of the database
define('DB_USER', 'root'); // Your MySQL username
define('DB_PASSWORD', ''); // ...and password
define('DB_HOST', 'localhost'); // 99% chance you won't need to change this value
Those are the WordPress config settings that are not working. I get Error establishing a database connection ...
I can use those same credentials to log in to MySql/localhost using MySql Query Browser.
The DB is running. I've tried restarting Apache and MySql to no avail.
Mmmm I don't see anything regarding mysql extensions:
mysql
Active Persistent Links 0
Active Links 0
Client API version 4.1.22
MYSQL_MODULE_TYPE external
MYSQL_SOCKET /var/mysql/mysql.sock
MYSQL_INCLUDE -I/usr/include/mysql
MYSQL_LIBS -L/usr/lib/mysql -lmysqlclient
Directive Local Value Master Value
mysql.allow_persistent On On
mysql.connect_timeout 60 60
mysql.default_host no value no value
mysql.default_password no value no value
mysql.default_port no value no value
mysql.default_socket no value no value
mysql.default_user no value no value
mysql.max_links Unlimited Unlimited
mysql.max_persistent Unlimited Unlimited
mysql.trace_mode Off Off
I would download phpMyAdmin and see if it is able to connect to the database. Not sure what else the problem could be. The wordpress error is vague. Do you know how to write a short script that will connect to the db?
Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2) in /Users/matth/Sites/php/index.php on line 7
MySQL said: Error: 2002 - Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2)
Looks like my.cnf file had nothing in it (except old-passwords flag that I just put in), and I think that's the culprit. I didn't realize it should be populated with configurations until I started messing around with mysql Administrator.
Then I saw when I activated the port setting it wrote to my.cnf file.
I'd use that app to configure mysql, but I'm not sure what the settings should be. Can you suggest where to go to get one that's generally configured for simple localhost testing/dev?
Your MySQL distribution should already have several my.cnf option files to choose from. I usually use the 'my-medium.cnf' file and just rename it 'my.cnf'. You can find more information on the config files here.