Jump to content

Could not connect to the database - check the database connection details you entered


kenwardc

Recommended Posts

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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".

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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';

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 4 weeks later...
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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated