
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.
====================
_________________
- |
 |
 |
mamboBROWN
Posts: 1713
|
| Posted: 06/21/2007, 8:20 PM |
|
dmvito
What version of PHP and MySQL are you using??
|
 |
 |
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.
|
 |
 |
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
_________________
- |
 |
 |
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
_________________
- |
 |
 |
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.
|
 |
 |
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/
>
|
|
|
 |
|

|
|
|
|