CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Problem with MySQL database, pconnect failed

Print topic Send  topic

Author Message
dmvito

Posts: 6
Posted: 06/21/2007, 4:03 PM

People, I really appreciate any help

I finished my project developed with codecharge in language php, using a MySQL database.
It works locally, but when I uploaded it to a webhosting, changing parameters of server URL and database connection directly on the common.php file or previously changing project/settings/publishing ->Server URL and project/settings/connections/server...
Pages of my project can't access to the database on the webhosting.

I tryied with two situations and you will see the answers

What shoul I do?


SITUATION A

Common.php code:
=======================


define("ServerURL", "http://www.forumdesalternatives.org/");

$this->DB = "MySQL";
$this->DBDatabase = "sql44995_2";
$this->DBHost = "hostIP";
$this->DBUser = "Sql44995";
$this->DBPassword = "password";
========================

Answer from sever:

======================
Database error: cannot use database sql44995_2
MySQL Error: 1044 (Access denied for user: 'Sql44995@%' to database 'sql44995_2')
Session halted.
======================


SITUATION B

Common.php code:
=======================

define("ServerURL", "http://www.forumdesalternatives.org/");

$this->DB = "MySQL";
$this->DBDatabase = "sql44995_2";
$this->DBHost = "localhost";
$this->DBUser = "Sql44995";
$this->DBPassword = "password";

========================

Answer from sever:

======================

Warning: mysql_pconnect() [function.mysql-pconnect]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /web/htdocs/www.forumdesalternatives.org/home/db_mysql.php on line 97
Database error: pconnect(localhost, Sql44995, $DBPassword) failed.
MySQL Error: 0 ()
Session halted.
====================



_________________
-
View profile  Send private message
mamboBROWN


Posts: 1713
Posted: 06/21/2007, 8:20 PM

dmvito
What version of PHP and MySQL are you using??
View profile  Send private message
RonB

Posts: 228
Posted: 06/22/2007, 12:01 AM

I think mambo's question is valid (as usual :-) ) Looks like a mismatch of mysql clients. If you are using mysqli local and your host does not support that make sure you use the normal mysql libraries. Also make sure you use php4 and not php5 if your host does not support php5 (most of them are still on php4)

Another possibility is that your isp does noet use localhost for the mysql databse. In that case make sure you have the correct ip for the database server at your host. I have several clients that do not use locahost but have separate Apache and mysql servers.
View profile  Send private message
dmvito

Posts: 6
Posted: 06/22/2007, 7:12 AM

This is my local and the hosting server configuration:

Local configuration: Hosting Server configuration:
PHP Version 4.3.10 PHP 4.xx
MySQL - 4.0.20a-nt MySQL - 4.0.27-standard-log
_________________
-
View profile  Send private message
dmvito

Posts: 6
Posted: 06/22/2007, 7:16 AM

Sorry, this is more readable:

Local configuration:
PHP Version 4.3.10
MySQL - 4.0.20a-nt

Hosting Server configuration:
PHP 4.xx
MySQL - 4.0.27-standard-log
_________________
-
View profile  Send private message
mamboBROWN


Posts: 1713
Posted: 06/23/2007, 8:58 PM

dmvito
RonB is right check with your ISP and see how they wish for you to refer to the MySQL database. That maybe the solution to your problem.
View profile  Send private message
Bryan
Posted: 06/24/2007, 7:28 AM

As far as I know, pconnects are disabled in mysqli.

Here's why:

http://www.mysqlperformanceblog.com/2006/11/12/are-php-...nnections-evil/

Bryan


dmvito wrote:
> People, I really appreciate any help
>
> I finished my project developed with codecharge in language php, using a MySQL
> database.
> It works locally, but when I uploaded it to a webhosting, changing parameters
> of server URL and database connection directly on the common.php file or
> previously changing project/settings/publishing ->Server URL and
> project/settings/connections/server...
> Pages of my project can't access to the database on the webhosting.
>
> I tryied with two situations and you will see the answers
>
> What shoul I do?
>
>
> SITUATION A
>
> Common.php code:
> =======================
>
>
> define("ServerURL", "http://www.forumdesalternatives.org/");
>
> $this->DB = "MySQL";
> $this->DBDatabase = "sql44995_2";
> $this->DBHost = "hostIP";
> $this->DBUser = "Sql44995";
> $this->DBPassword = "password";
> ========================
>
> Answer from sever:
>
> ======================
> Database error: cannot use database sql44995_2
> MySQL Error: 1044 (Access denied for user: 'Sql44995@%' to database
> 'sql44995_2')
> Session halted.
> ======================
>
>
> SITUATION B
>
> Common.php code:
> =======================
>
> define("ServerURL", "http://www.forumdesalternatives.org/");
>
> $this->DB = "MySQL";
> $this->DBDatabase = "sql44995_2";
> $this->DBHost = "localhost";
> $this->DBUser = "Sql44995";
> $this->DBPassword = "password";
>
> ========================
>
> Answer from sever:
>
> ======================
>
> Warning: mysql_pconnect() [function.mysql-pconnect]: Can't connect to local
> MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in
> /web/htdocs/www.forumdesalternatives.org/home/db_mysql.php on line 97
> Database error: pconnect(localhost, Sql44995, $DBPassword) failed.
> MySQL Error: 0 ()
> Session halted.
> ====================
>
>
>
> _________________
> -
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
Bryan
Posted: 06/24/2007, 7:33 AM


From the PHP mysqli ext manual:

The mysqli extension allows you to access the functionality provided by
MySQL 4.1 and above. More information about the MySQL Database server
can be found at » http://www.mysql.com/

Looks like you are trying to use mysqli with a version of MySQL which is
too old.

However, that won't solve your problem. See my other message about
pconnect() being disabled in mysqli.

Bryan

dmvito wrote:

> This is my local and the hosting server configuration:
>
> Local configuration: Hosting Server configuration:
> PHP Version 4.3.10 PHP 4.xx
> MySQL - 4.0.20a-nt MySQL - 4.0.27-standard-log
> _________________
> -
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.