PDA

View Full Version : DB Connect problem


is99
04-04-05, 09:54 PM
I have a Linux Box running Fedora, this box runs Mantis and it works with MySQL fine.

dotProject Installer say that MySql support is ok, and that I have no problem.

In the next page of the installer when I try to create a new DB it writes:
Creating new Database
Installing database
There were 0 errors in 198 SQL statements
FATAL ERROR: Connection to database server failed

I tryed to put in the SQL connection a name of a user that have all rights in MySQL and nothing.
Then I tryed to put there a root with its password and also the same error :x

I then manually created a DB and tryed to work and whn I try to logon to dotProjectI also get an error that I have a problem to connect to MySQL.

Any ideas what can be the problem ?

ajdonnison
04-04-05, 10:07 PM
This looks strange as it is reporting that it created the database and created the tables (the 0 errors), but then reports an error in the connection. It may be that the error is deferred, but even so there should be errors reported in executing the SQL statements. Can you try creating the database (but no tables) before you do the install, and make sure you do not have Drop Existing Database checked.

is99
04-04-05, 11:03 PM
First of all despite the fact that it reports 0 errors nothing is created in MySQL

About "Can you try creating the database (but no tables) before you do the install, and make sure you do not have Drop Existing Database checked."
I got the same error and nothing was created on the DB

In both cases I used root user so there should be no permission problem, and as I wrote before I have Mantis running on the same box so there should be no problem with MySQL

trimble
05-04-05, 01:19 AM
Yes, I've received the same error during both v2 dotProject upgrades and clean installs on a Slackware box connecting to an external MySQL database and on a RedHat box running a localhost MySQL database.

My first attempt on the Slackware box was an upgrade and ran without database errors, but in that case I was greeted with a WhiteScreenOFDeath after the installation was finished. Now I'm only receiving database errors with both upgrades and (apparently) clean installs.

is99
05-04-05, 01:36 AM
One more thing about my problem.
I installed v1 of dotProject on the same box a few months ago and it was working fine.

So I guess there is some problem with v2 and I will be very happy if someone could give me some idea how to solve this problem

jbulick
05-04-05, 02:34 AM
I am having the same problem but on a different setup. I am running a Win2K server with Php 4.3.11 and MySQL 4.1.10a. I have tried uninstalling and reinstalling each program several times as well as formating the server and staring fresh. Below is the error I get:
Creating new Database
Installing database
There were 0 errors in 198 SQL statements

Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client in D:\Inetpub\www\famc-hq\lib\adodb\drivers\adodb-mysql.inc.php on line 327
FATAL ERROR: Connection to database server failed


I tried using Php 5.0.4 as well and got the following error:
Fatal error: Call to undefined function mysql_connect() in D:\Inetpub\www\famc-hq\lib\adodb\drivers\adodb-mysql.inc.php on line 326

Any help on this would be hugely appreciated.

ajdonnison
05-04-05, 09:02 AM
Searching for your error comes up with this:

http://www.dotproject.net/index.php?name=PNphpBB2&file=viewtopic&t=1064&highlight=client+support+authentication+protocol+r equested+server

Note the third or so reply where it gives details of this error and what causes it.

is99
05-04-05, 03:39 PM
"Client does not support authentication protocol requested by server" Has nothing to do with my problem.

Is there anyone who have any idea what can be the problem in my case ?

ajdonnison
05-04-05, 03:47 PM
A few questions then, is99:

1. What version of MySQL are you running?
2. Is PHP running in CGI or SAPI mode under Apache?
3. Is this a clean install or an upgrade?

is99
05-04-05, 04:01 PM
1. 3.23.58

2. CGI - I belive this is the problem, what should I do? How can I change the mode ?

3. This is a clean install.

ajdonnison
05-04-05, 04:19 PM
This sounds like the same problem that some people are having with CGI in running dotProject, although it shouldn't have any effect on the installer. Just to eliminate this as a possibility can you make the same changes that I mention in http://www.dotproject.net/index.php?name=PNphpBB2&file=viewtopic&t=2259#8876 to install/do_install_db.php and try again? I am not expecting it to make any difference, but we need to eliminate it as it is a known cause of problems with other aspects of the code.

As to changing CGI mode, the default Fedora (at least in Core 3) install of Apache/PHP is SAPI mode, so you may want to go back to that, making sure you have all of the php modules installed (like php_mysql). If you have crafted it yourself you need to configure it with --with-apxs or --with-apxs2 before you compile. Check the installation instructions that came with the source.

is99
05-04-05, 04:37 PM
After the change in the do_install_db.php I got the same error.

About the CGI mode, I do have Fedora Core 3 and I dont remember thta I did any changes in PHP so its strange.
But I will try to change it to SAPI and see if it will help.

is99
05-04-05, 04:52 PM
Actually I removed the PHP from this box and reinstalled it from from fedora site and its still CGI so I guess that Fedora CORE 3 comes with CGI and not SAPI.

I belive this can be a problem for dotProject because having a problem on Fedora can affect too many users.

Anyway I will try to install php manually in SAPI mode.

ajdonnison
05-04-05, 04:53 PM
Are you using the same database user as your Mantis install? Remembering that database users are not the same as Linux users?

is99
05-04-05, 04:56 PM
Yes sure I'm aware that linux users and mysql users are two different things.

No I'm not using the same user as mantis.
I created a user for dotproject and I also tried to use root

ajdonnison
05-04-05, 05:06 PM
Actually I removed the PHP from this box and reinstalled it from from fedora site and its still CGI so I guess that Fedora CORE 3 comes with CGI and not SAPI.

How are you determining this? I have a clean FC3 system here, and phpinfo returns Server API as "Apache 2.0 Handler", which is SAPI mode. Can you check your dotproject/docs/phpinfo.php and see if it returns the same?

is99
05-04-05, 05:13 PM
Actually I run php -v and not via phpinfo

phpinfo returns Apache 2.0 Handler.

So I'm sorry this was my mistake to run php -v

Anyway if this is not a problem any ideas what i my problem with DB connection ?

ajdonnison
05-04-05, 05:18 PM
Can't tell. I've just done a full install on FC3, no hassles. I know this doesn't help, but it satisfies me that it is a local configuration issue. Can you give me any more detail on your setup?

is99
05-04-05, 05:29 PM
In general its Fedora Core 3 box running only mantis and fully updated with yum to the latest versions Fedora has.

what other info do you need to know ?

ajdonnison
05-04-05, 05:34 PM
And your phpinfo page is showing a mysql module block with the version etc?

is99
05-04-05, 05:51 PM
yes here it is:

mysql
MySQL Support enabled
Active Persistent Links 0
Active Links 0
Client API version 3.23.58
MYSQL_MODULE_TYPE external
MYSQL_SOCKET /var/lib/mysql/mysql.sock
MYSQL_INCLUDE -I/usr/include/mysql
MYSQL_LIBS -L/usr/lib/mysql -lmysqlclient

Directive Local Value Master Value
mysql.allow_persistent On On
mysql.connect_timeout 60 60
mysql.default_host no value no value
mysql.default_password no value no value
mysql.default_port no value no value
mysql.default_socket no value no value
mysql.default_user no value no value
mysql.max_links Unlimited Unlimited
mysql.max_persistent Unlimited Unlimited
mysql.trace_mode Off Off

ajdonnison
05-04-05, 05:54 PM
OK, do you have the MySQL-shared-compat RPM installed? This provides compatiblity between the PHP handling and the MySQL handling, so the client API works correctly.

is99
05-04-05, 07:23 PM
No I dont have it, I see that its not part of Fedora

I will get it from mysql.com and inform you about the resaults.

ajdonnison
05-04-05, 07:23 PM
I've just spent some time with another FC3 user on irc with exactly the same symptoms, and was able to resolve it, however I don't think you would be having the same issue. Basically their database user was set up with permissions from All hosts, (user@%). However they were using localhost as the database host, and MySQL permissions do not allow user@localhost unless you specify it explicitly. As soon as they added a user@localhost with the correct permissions they were able to succesfully install.

You might just want to check using the mysql command line that your user has the permissions you think they have:

mysql --user=dp_user --password=dp_pass --host=localhost databasename

Set the dp_user, dp_pass, localhost and databasename to those used in the installation script. It should either connect or tell you the database doesn't exist. If it comes back with a user error, then you know you have user permission issues.

is99
05-04-05, 07:36 PM
Actually It solved the problem.
My user was from any.

What is interesting is why when i used root it dosnt work - my root configured for localhost.

Thank you very much for your time.

trimble
06-04-05, 03:24 AM
The thing that's perplexing me about this DB Connect error is that when I restore my v1.0.2 dotProject web and database installation using the same host, database, user, and password... everything works.

trimble
06-04-05, 03:39 AM
In my case I'm running Slackware 10.1 on both my web server (Apache 1.3.33, PHP 4.3.10) and database server (MySQL 4.0.23a). I've verified that the database user I'm using in my DP config can connect to my DP database from my web server (using the mysql script you provided above). I can see all tables in the installation. This user also has been granted all permissions on the server.

ajdonnison
06-04-05, 07:59 AM
So what errors are you getting? How far does it get into the install?

trimble
06-04-05, 11:54 AM
For a description of my problem(s), please refer to thread http://www.dotproject.net/index.php?name=PNphpBB2&file=viewtopic&t=2241

The farthest I've gotten is with my first upgrade, when I made it to a screen that reported the dotProject and database upgrades were successful. My problem with this initial upgrade surfaced when I clicked on the config link and consistently ran into a blank whitescreen.

All subsequent upgrades did not make it this far and reported the "FATAL: Database connection error" along with several SQL update/insert errors specified earlier in this thread as well as in my linked thread.

All "clean" installs I've attempted (old dotproject web directory deleted and replaced with new v2 extraction and new database created during install) have not made it to the "successful" install page, but have instead reported a 'Database Connection Error" before any SQL update/insert messages are displayed.

During all upgrades I've used the same host, database, user, password which has and continues to work with my v1.0.2 install.