kenwardc Posted October 17, 2010 Share Posted October 17, 2010 Hi folks I'm getting this error when attempting to install. At this point it's not clear whether the folks at WHMCS know why it's happening so I thought I would throw it out to you all in case someone has seen this and fixed it. The error is: Could not connect to the database - check the database connection details you entered and go back and correct them if necessary When I bring up a browser and go to http://myserver.com/whmcs.install/install.php it brings up the install scripts and all looks good. PASS next to all checks and then when I enter my trial licence key and the details for the database, I get the error above. Systtem is a CentOS 5.3 server running x86_64 bit. Apart from the error, all appears to be OK. I can access the database from my desktop at the office using MySQL Administrator or phpMyAdmin. Passwords all work fine and the view of the database etc. all normal. Any help would be good. I'm already about four days into my 15 day trial.... I want to try this thing before it dies on me. Best wishes Chris 0 Quote Link to comment Share on other sites More sharing options...
kenwardc Posted October 18, 2010 Author Share Posted October 18, 2010 As an aside, and in case it helps anyone help me solve this issue, it appears my MySQL database server is set up for innoDB. Is this OK for WHMCS or should it be set to ISAM? Cheers Chris 0 Quote Link to comment Share on other sites More sharing options...
m00 Posted October 18, 2010 Share Posted October 18, 2010 Place the following script in an empty PHP-file and replace sql-user, sql-password and sql-database (and when needed the host) with the same credentials as you use during the WHMCS installation: <?php $link = mysql_connect("localhost", "sql-user", "sql-password"); if(!$link) die("Error: ".mysql_error()); $db_selected = mysql_select_db("sql-database", $link); if(!$db_selected) die("Error: ".mysql_error()); ?> Do you get any errors? 0 Quote Link to comment Share on other sites More sharing options...
kenwardc Posted October 18, 2010 Author Share Posted October 18, 2010 Hi there Many thanks for the reply. Do I put this into a ".php" web page or run it in a query window via the control panel? Sorry - a bit dumb when it comes to MySQL. Cheers Chris 0 Quote Link to comment Share on other sites More sharing options...
m00 Posted October 18, 2010 Share Posted October 18, 2010 Hi there Many thanks for the reply. Do I put this into a ".php" web page or run it in a query window via the control panel? Sorry - a bit dumb when it comes to MySQL. Cheers Chris You can just put it in a new .php "web page". 0 Quote Link to comment Share on other sites More sharing options...
kenwardc Posted October 18, 2010 Author Share Posted October 18, 2010 OK! - Will do that now and let you know what happens. SO frustrated with the fact that I can't get this to work and I don't seem to be getting much in the way of help from the tech support guys. <grumble> 0 Quote Link to comment Share on other sites More sharing options...
kenwardc Posted October 18, 2010 Author Share Posted October 18, 2010 Hi m00 Well - I'm stumped again. This is the result of the test.... Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'whmcs'@'localhost' (using password: YES) in /var/www/html/test2.php on line 2 Error: Access denied for user 'whmcs'@'localhost' (using password: YES) If I use the exact same credentials from "outside" say using MySQL Administrator on my local Windows desktop, then I can log in, create tables, etc. all without any trouble at all. Is this a permissions thing do you think? Thanks again for the help! Cheers Chris 0 Quote Link to comment Share on other sites More sharing options...
kenwardc Posted October 18, 2010 Author Share Posted October 18, 2010 Hey, m00 I've had a thought - tried to use the local root username and password to access the database and it worked just fine. This would seem to indicate that there are permissions issues with the whmcs user I created. Even if I give the whmcs user ALL permissions the same as root, then it still does not connect. Could this be a disk/folder permissions issue you think? The files in the whmcs web space are all owned by apache (owner) and users (group). Not sure if this helps? Cheers Chris 0 Quote Link to comment Share on other sites More sharing options...
laszlof Posted October 18, 2010 Share Posted October 18, 2010 usernames can be setup to work from different hosts. Its possible that you are setup to allow the "whmcs" user only access from your remote machine. try running this from phpmyadmin or the mysql command line utility: GRANT ALL PRIVILEGES ON whmcsdatabase.* TO 'whmcsuser'@'localhost' IDENTIFIED BY 'password'; 0 Quote Link to comment Share on other sites More sharing options...
kenwardc Posted October 18, 2010 Author Share Posted October 18, 2010 THANK YOU to m00 for all your help and to laszlof for the SQL code above, which worked and gave my whmcs user the permissions needed to connect to the database! FANTASTIC - I now know where to come when I need help and/or support with this product. I've begun doing the configuration - wow - looks good so far. All the best! Chris 0 Quote Link to comment Share on other sites More sharing options...
alexsilvausa Posted November 13, 2010 Share Posted November 13, 2010 usernames can be setup to work from different hosts. Its possible that you are setup to allow the "whmcs" user only access from your remote machine. try running this from phpmyadmin or the mysql command line utility: GRANT ALL PRIVILEGES ON whmcsdatabase.* TO 'whmcsuser'@'localhost' IDENTIFIED BY 'password'; What should i do now? I am not able to install the whmcs on my host. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.