11
ghia
Re: Can not connect to Mysql Db - however I intalled many Xoops
  • 2008/11/18 13:11

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Quote:
Database is on calango.dot5hostingmysql.com
Are you sure?
It does not translate to an IP address.
Do you mean your database is at a different server then your site? Mosttimes the ports used for the database are closed for security reasons.
Quote:
I know it's ok because I just installed XOOPS 2.0.18 in the same database!
Was it on the same server and the same domain?

12
Rickb
Re: Can not connect to Mysql Db - however I intalled many Xoops
  • 2008/11/18 15:38

  • Rickb

  • Not too shy to talk

  • Posts: 118

  • Since: 2004/10/24


Quote:
If you put the right values, it just reloads the page without the entered values


This is a clear indication that the session is not being saved - and is not a XOOPS issue.

Please Skype me so that I may assist you. Skype: rick-eiproject

Looks like to me the operator has the script and the database on 2 separate servers.

Rick

13
triwaca
Re: Can not connect to Mysql Db - however I intalled many Xoops
  • 2008/11/19 11:53

  • triwaca

  • Just popping in

  • Posts: 11

  • Since: 2007/1/3 2


Quote:
This is a clear indication that the session is not being saved


Does the XOOPS installer use the /xoops_data folder? The permissions on it are OK.

the script and the database on 2 separate servers


Probably... Localhost doesn't work.

Please Skype me...


Thanks a lot for the help, but i'm without Skype! My 3G internet doesn't support!

Well, i'll try someting hardcore: Install by hand! Will fill the MySQL with an local instalation, and load the right values on mainfile.php by FTP. Let's see what happens!


14
ghia
Re: Can not connect to Mysql Db - however I installed many Xoops
  • 2008/11/19 13:56

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


I don't think it is a session problem. If you do the install with localhost the values for user and password are preserved. Only if you use the indicated MySQL servername, there is a kind of reset. So, it seems it can connect to the MySQL database server in the first place but fails later in the routine.
$error '';
if ( 
$_SERVER['REQUEST_METHOD'] == 'POST' && !empty( $vars['DB_HOST'] ) && !empty( $vars['DB_USER'] ) ) {
    
$func_connect = empty( $vars['DB_PCONNECT'] ) ? "mysql_connect" "mysql_pconnect";
    if ( ! ( 
$link = @$func_connect$vars['DB_HOST'], $vars['DB_USER'], $vars['DB_PASS'], true ) ) ) {
        
$error ERR_NO_DBCONNECTION;
    }
    if ( empty( 
$error ) ) {
        
$wizard->redirectToPage'+1' );
        exit();
    }
}

In the next step this is repeated:
$vars =& $_SESSION['settings'];

    
$func_connect = empty( $vars['DB_PCONNECT'] ) ? "mysql_connect" "mysql_pconnect";
    if ( ! ( 
$link = @$func_connect$vars['DB_HOST'], $vars['DB_USER'], $vars['DB_PASS'], true ) ) ) {
        
$error ERR_NO_DBCONNECTION;
        
$wizard->redirectToPage'-1'$error );
        exit();
    }
So, if it fails for the second connection attempt, you are redirected to the former step.
My remarks on this:
-1- The real problems are masked by using generic error messages. At least mysql_error() should be called to supply as much information possible of the fault.
-2- The first connection is not ended with eg.
mysql_close($link);
. This can be a problem on systems which limit the number of concurrent database connections.

Try by modifying in /install/page_dbconnection.php to
$error '';
if ( 
$_SERVER['REQUEST_METHOD'] == 'POST' && !empty( $vars['DB_HOST'] ) && !empty( $vars['DB_USER'] ) ) {
    
$func_connect = empty( $vars['DB_PCONNECT'] ) ? "mysql_connect" "mysql_pconnect";
    if ( ! ( 
$link = @$func_connect$vars['DB_HOST'], $vars['DB_USER'], $vars['DB_PASS'], true ) ) ) {
        
$error ERR_NO_DBCONNECTION.mysql_error();
    }
    
mysql_close($link);
    if ( empty( 
$error ) ) {
        
$wizard->redirectToPage'+1' );
        exit();
    }
}
and in /install/page_dbsettings.php add only the extended error reporting.

15
triwaca
Re: Can not connect to Mysql Db - however I intalled many Xoops
  • 2008/11/20 12:45

  • triwaca

  • Just popping in

  • Posts: 11

  • Since: 2007/1/3 2


Hi everybody,

Well, my on-hand instalation worked fine, and the website is running ok. But the normal installation still isn't working on my host (dot5hosting.com).

Ghia was right: it is not a session problem.

Quote:
it seems it can connect to the MySQL database server in the first place but fails later in the routine.


The first connection, page_dbconnection.php, works fine. But the second connection, page_dbsettings.php, didn't work and redirects to dbcoonection again, now without the values, and without the error message (probabily because the
$error ''
contained in dbconnection).

I'm waiting the answer from my host about limits in concurrent database connections.

I tried the modifications sugested by ghia (close connection, + MySQL error), but it didn't work. I'll try later comment some lines avoiding the first connection in page_dbconnection.php.

Thanks for help!

16
Rickb
Re: Can not connect to Mysql Db - however I intalled many Xoops
  • 2008/11/20 15:18

  • Rickb

  • Not too shy to talk

  • Posts: 118

  • Since: 2004/10/24


What you have discovered will be of use to others. In a non shared environment, our php.ini was not writable. When the correct data entered and no error was given back, the data for the database form, would not save. The php.ini file did not allow the session to be saved until it was made writable.

In a shared host, an ini file permissions would not be the issue. You are having the same symptoms but from a different set of conditions.

Rick

17
kitkitkit
Re: Can not connect to Mysql Db - however I intalled many Xoops
  • 2008/11/23 19:54

  • kitkitkit

  • Just popping in

  • Posts: 1

  • Since: 2008/11/23


I cannot pass the installation step 5 too but not sure it's the same case as yours or not.

In my case, it's related to the host session setting. I added the following host setting by mistake during my copy and paste action:

php_flag session.cookie_secure On

This line cause session problem at my XOOPS with http host and make MySQL login information cannot pass from dbconnection to the dbsettings page.

After remove this line from my Apache config and restart Apache service, my XOOPS installation can be continued without problem.


18
Rickb
Re: Can not connect to Mysql Db - however I intalled many Xoops
  • 2008/11/24 15:28

  • Rickb

  • Not too shy to talk

  • Posts: 118

  • Since: 2004/10/24


Please try this, clear cache then close your browser, do not save that session as Firefox allows. Then reopen and try to see if that line has any affect.

Rick

19
sailjapan
Re: Can not connect to Mysql Db - however I intalled many Xoops

Looks like kitkitkit's solved his/her problems.
Never let a man who does not believe something can be done, talk to a man that is doing it.

20
Shaoying
Re: Can not connect to Mysql Db - however I intalled many Xoops
  • 2008/12/22 7:26

  • Shaoying

  • Just popping in

  • Posts: 1

  • Since: 2008/12/22


I have the same problem: Can not connect to Mysql.
I tried both "localhost" and the url listed on the web server.


I also use dot5hosting.com. What's the solution triwaca used to make the system work?

Thanks in advanced for any help I can get.

Login

Username:
Password:

Lost Password? Register now!

Who's Online

86 user(s) are online (56 user(s) are browsing Support Forums)


Members: 2


Guests: 84


Cesagonchu, heyula,

more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits