Ok, this will be a long question.
I'm trying to get something up and running on my university account. We have a public_html folder that we can use as web space to host anything we want there.
I've installed Bitnami lamp stack in the public_html folder (probably not the best idea, security-wise, but I'm only going to test this application for a couple of days and pull it down so I really don't care so long I can get this up and running fast) and the site I want to host is working fine and accessible via (http:// (uni address)/(my account name)/public_html/lamp/apache2/htdocs/(etc..). However, certain parts of the code that connects to the databse gives me the following warning:
Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
I'm connecting to the database using the following code:
mysql_connect($CFG->dbhost,$CFG->dbuser,$CFG->dbpass);
Where dbhost is 'localhost'.
Since it's referencing /var/run/mysqld/mysqld.sock - it obviously means it's trying to connect to the wrong thing as the mysql in the lamp stack I've installed have the following in its my.cnf:
[mysqladmin]
user=root
[mysqld]
basedir=(my account folder)/public_html/lamp/mysql
datadir=(my account folder)/public_html/lamp/mysql/data
port=3306
socket=(my account folder)/public_html/lamp/mysql/tmp/mysql.sock
tmpdir=(my account folder)/public_html/lamp/mysql/tmp
[mysqld_safe]
mysqld=mysqld.bin
[client]
port=3306
socket=(my account folder)/public_html/lamp/mysql/tmp/mysql.sock
[manager]
port=3306
socket=(my account folder)/public_html/lamp/mysql/tmp/mysql.sock
pid-file=(my account folder)/public_html/lamp/mysql/tmp/manager.pid
default-mysqld-path=(my account folder)/public_html/lamp/mysql/bin/mysqld.bin
So my question is, anyone know how to get it to connect to the correct socket? Also, var/run/mysqld/mysqld.sock doesn't exist at all and I obviously don't have the permission to create it (not that I see how it serves my purpose at all).
This had been plaguing me since yesterday. Any help would be greatly appreciated.
Cheers!