Could not connect to database

Help with getting the CMS CORE package up and running. This does not include 3rd party modules, PHP scripts, anything downloaded via module manager or from any external source.
Locked
apesaga

Could not connect to database

Post by apesaga »

Hello,

I'm having a few problems getting CMS made simple installed.

I'm using a Windows 2003 box with PHP 4.4.2 and MySql 4.1.18

CMS Made Simple version 0[1].12.1 (?)

I get to the stage where it tries to create the database tables and get the dreaded

"Could not connect to database. Verify that username and password are correct, and that the user has access to the given database."

I followed the instructions on the page, where it says to log into MySql from a console and run the two commands. I checked in MySql Administrator and the user has been created and does have permissions on the CMS database.

I noticed a few people have had this problem before, but no-one has actually posted what they did get fix it!

I have even tried using the root account but that gave me the same error.

Can someone please share with me the secret to getting past this stage?

Many thanks
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Could not connect to database

Post by calguy1000 »

If you have shell access to the computer, try typing this:

mysql -U -P

it should prompt you for the password,

and if you get in, then you know it's not a problem with mysql, but rather with your settings in the config.php file.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
apesaga

Re: Could not connect to database

Post by apesaga »

I fixed the problem.

It turned out to be (and I should have seen this coming, but I was tired yesterday) the well documented problem connecting certain versions of PHP to new versions of MySql.

Apparently the password hashing algorithm was modified in MySql 4.1 and this can lead to problems when clients (in this case PHP) try to connect using the old algorithm.

I fixed it by telling my installation of MySql to allow the old style passwords (add the line old-passwords to my.ini). This half solved the problem, but when I created the cms_user account it assigned it a new style password so I got the "cannot connect" error again.

I then ran a query which used the old_password('password') function to update the cms_user password in the users table and assign it an old style password. Then everything worked ok.

I thought I'd post this in case anyone else has the same problem.
Sub_Kovert

Re: Could not connect to database

Post by Sub_Kovert »

apesaga thank you so much you are a star  :)

- I have been trying to sort this out for over a week now and finally managed to get it up and running tonight.

I love this software already - goodbye to the ASP and MSSQL stuff I have used before
oxopo

Re: Could not connect to database

Post by oxopo »

apesaga wrote: I fixed the problem.

It turned out to be (and I should have seen this coming, but I was tired yesterday) the well documented problem connecting certain versions of PHP to new versions of MySql.

Apparently the password hashing algorithm was modified in MySql 4.1 and this can lead to problems when clients (in this case PHP) try to connect using the old algorithm.

I fixed it by telling my installation of MySql to allow the old style passwords (add the line old-passwords to my.ini). This half solved the problem, but when I created the cms_user account it assigned it a new style password so I got the "cannot connect" error again.

I then ran a query which used the old_password('password') function to update the cms_user password in the users table and assign it an old style password. Then everything worked ok.

I thought I'd post this in case anyone else has the same problem.

how do i do the query part ?
Locked

Return to “[locked] Installation, Setup and Upgrade”