PDA

View Full Version : mysql04 ERROR - Can't Connect


construaprende
6-16-05, 10:03 PM
Hi

I have phpadsnew installed in mysql04.powweb.com

Suddenly, It just stop working

The error says:

*********************
A fatal error occurred

phpAdsNew can't connect to the database. Because of this it isn't possible to use the administrator interface. The delivery of banners might also be affected. Possible reasons for the problem are:
The database server isn't functioning at the moment
The location of the database server has changed
The username or password used to contact the database server are not correct
********************
I check again username and password, and it's ok, but the script can't connect to database

I try with phpmyadmin, and username and password work fine

Is mysql04.powweb.com having problems?

Some days ago, I had problems with this database, intermintent conections problem, sometimes I could not connect, but if I reloaded, I could conect again... But now, it's not working any more, even if I reload

I already submit a Support Ticket

You can see this error in:

http://www.construaprende.com/banners/admin/

Thanks

RTH10260
6-16-05, 11:28 PM
Some days ago, I had problems with this database, intermintent conections problem, sometimes I could not connect, but if I reloaded, I could conect again... But now, it's not working any more, even if I reloadIntermittent connection problems is often a sign of hitting the hourly connect and query limits. Without knowing how the application works, no further diagnosis can be made. What other numbers about your website do you know (eg number of hits) ?

construaprende
6-16-05, 11:32 PM
The max number of hits of all site, in one day, is 294,757
(taking this data from webstats)

The error can be view in:
http://www.construaprende.com/banners/admin/

Regards..

mitchind
6-17-05, 12:40 AM
Intermittent connection problems is often a sign of hitting the hourly connect and query limits.
Richard is bang on - especially when you say you've got 294,757 hits in one day - you could be using up 72,000 queries in one hour easily.

See if you can modify the software to use all three database users - that'll give you close to the max 216,000 queries per hour.

If you can post your database connection code or script, someone here can help you modify it for the random user fix. Just make sure to block out your username/password info.

To start with go into Member Ops | Website | MySQL and add two more database users with passwords. Then post some code and we'll get going .... :)

construaprende
6-17-05, 12:53 AM
Hi..

Thanks

The original code of configuration is:
------------------------------------------------------------------

/************************************************** *******/
/* Database configuration */
/************************************************** *******/

// Database hostname
$phpAds_config['dbhost'] = 'localhost';

// Database port
$phpAds_config['dbport'] = '3306';

// Database username
$phpAds_config['dbuser'] = '';

// Database password
$phpAds_config['dbpassword'] = '';

// Database name
$phpAds_config['dbname'] = '';

// Database table names
$phpAds_config['tbl_adclicks'] = 'phpads_adclicks';
$phpAds_config['tbl_adviews'] = 'phpads_adviews';
$phpAds_config['tbl_adstats'] = 'phpads_adstats';
$phpAds_config['tbl_banners'] = 'phpads_banners';
$phpAds_config['tbl_clients'] = 'phpads_clients';
$phpAds_config['tbl_session'] = 'phpads_session';
$phpAds_config['tbl_acls'] = 'phpads_acls';
$phpAds_config['tbl_zones'] = 'phpads_zones';
$phpAds_config['tbl_config'] = 'phpads_config';
$phpAds_config['tbl_affiliates'] = 'phpads_affiliates';
$phpAds_config['tbl_images'] = 'phpads_images';
$phpAds_config['tbl_userlog'] = 'phpads_userlog';
$phpAds_config['tbl_cache'] = 'phpads_cache';
$phpAds_config['tbl_targetstats'] = 'tbl_targetstats';

// Database table name prefix
$phpAds_config['table_prefix'] = 'phpads_';

// Database table type
$phpAds_config['table_type'] = 'MYISAM';

// Use persistent connections to the database
$phpAds_config['persistent_connections'] = false;

// Use INSERT DELAYED in logging functions?
$phpAds_config['insert_delayed'] = false;

// Database compatibility mode to insure phpAdsNew
// won't disturb an available database connection
$phpAds_config['compatibility_mode'] = false;

-------------------------------------------------------------

Regards...

mitchind
6-17-05, 01:09 AM
This should now look like:

$phpAds_config['dbhost'] = 'mysql##.powweb.com'; // change to match your server


// Add this ...
//*************
$db_user[] = 'username1';
$db_user[] = 'username2';
$db_user[] = 'username3';
$db_pwd[] = 'password1';
$db_pwd[] = 'password2';
$db_pwd[] = 'password3';

$db_user_id = rand( 0, ( sizeof($db_user) -1 ) );
//*************

// Modify these lines ...
// **************************
// Database username
$phpAds_config['dbuser'] = $db_user[$db_user_id];

// Database password
$phpAds_config['dbpassword'] = $db_pwd[$db_user_id];
// **************************

If you want more details please see original post (http://forum.powweb.com/showthread.php?t=23735)

construaprende
6-17-05, 01:07 PM
Thanks a lot

I am going to try it


Regards....