So, I have a very simple php configuration file to connect to a MySQL Database, called
[Wed Jun 11 23:21:59 2014] [warn] [client 220.127.116.11] mod_fcgid: stderr: PHP Warning: mysql_connect(): Access denied for user 'db_user'@'localhost' (using password: YES) in /var/www/vhosts/~sitename~/httpdocs/modules/connect.php on line 2, referer: http:// ~sitename~/admin/login
[Wed Jun 11 23:21:59 2014] [warn] [client 18.104.22.168] mod_fcgid: stderr: PHP Warning: mysql_select_db(): Access denied for user ''@'localhost' (using password: NO) in /var/www/vhosts/~sitename~/httpdocs/modules/connect.php on line 3, referer: http:// ~sitename~/admin/login
[,,,] (more messages essentially saying it has not connected and as a result are trying to connect with no username and password)
mysql_connect('localhost', 'db_user', 'password');
SHOW GRANTS FOR db_user@'%';
##Grants for db_user@%##
`GRANT USAGE ON *.* TO 'db1'@'%' IDENTIFIED BY PASSWORD '*BEE6E9D5D5A3C2E1EC93EBCA0E4E527C0328BE01'`
GRANT ALL PRIVILEGES ON `db_user`.* TO 'db1'@'%'
Apparently in the database section there is a column named
Database server which gives the address of the database, which in my case simply was not
127.0.0.1 or anything like that!
I changed the address and off it worked!