Guest Posted January 10, 2006 Posted January 10, 2006 Warning: mysql_pconnect(): Lost connection to MySQL server during query in /home/keeg/www/admin/includes/functions/database.php on line 17 Unable to connect to database server! And the rest of the page is blank. This suddenly appeared when trying to access /admin Everything elso on the page works, and I have made no changes at all. Does anyone know what I should do to make it work ?
Guest Posted January 10, 2006 Posted January 10, 2006 OK, somewhat confusing message you posted - And the rest of the page is blank. Everything elso on the page works So, which is it? What were you doing when the rror happened, is it the entire page blank with just that message, or is it a section of the page displaying that message whilst everything else works? The answer to this question will make the solution SO much easier for those of us who cant see your screen to figure out what is happening!
Guest Posted January 10, 2006 Posted January 10, 2006 sorry.. See for yourself: http://keeg.no/admin/ www.keeg.no works great. But not the admin-section.
Guest Posted January 10, 2006 Posted January 10, 2006 line 17 of your database.php file reads: $$link = mysql_pconnect($server, $username, $password); amend this to: // $$link = mysql_pconnect($server, $username, $password); That should then allow you to enter your admin panel. Let me know if it works!
Guest Posted January 10, 2006 Posted January 10, 2006 It didn't make any difference..... <?php /* $Id: database.php,v 1.21 2003/06/09 21:21:59 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ function tep_db_connect($server = DB_SERVER, $username = DB_SERVER_USERNAME, $password = DB_SERVER_PASSWORD, $database = DB_DATABASE, $link = 'db_link') { global $$link; if (USE_PCONNECT == 'true') { // $$link = mysql_pconnect($server, $username, $password); } else { $$link = mysql_connect($server, $username, $password); } if ($$link) mysql_select_db($database); return $$link; } function tep_db_close($link = 'db_link') { global $$link; return mysql_close($$link); } function tep_db_error($query, $errno, $error) { die('<font color="#000000"><b>' . $errno . ' - ' . $error . '<br><br>' . $query . '<br><br><small><font color="#ff0000">[TEP STOP]</font></small><br><br></b></font>'); } function tep_db_query($query, $link = 'db_link') { global $$link; if (defined('STORE_DB_TRANSACTIONS') && (STORE_DB_TRANSACTIONS == 'true')) { error_log('QUERY ' . $query . "\n", 3, STORE_PAGE_PARSE_TIME_LOG); } $result = mysql_query($query, $$link) or tep_db_error($query, mysql_errno(), mysql_error()); if (defined('STORE_DB_TRANSACTIONS') && (STORE_DB_TRANSACTIONS == 'true')) { $result_error = mysql_error(); error_log('RESULT ' . $result . ' ' . $result_error . "\n", 3, STORE_PAGE_PARSE_TIME_LOG); } return $result; } function tep_db_perform($table, $data, $action = 'insert', $parameters = '', $link = 'db_link') { reset($data); if ($action == 'insert') { $query = 'insert into ' . $table . ' ('; while (list($columns, ) = each($data)) { $query .= $columns . ', '; } $query = substr($query, 0, -2) . ') values ('; reset($data); while (list(, $value) = each($data)) { switch ((string)$value) { case 'now()': $query .= 'now(), '; break; case 'null': $query .= 'null, '; break; default: $query .= '\'' . tep_db_input($value) . '\', '; break; } } $query = substr($query, 0, -2) . ')'; } elseif ($action == 'update') { $query = 'update ' . $table . ' set '; while (list($columns, $value) = each($data)) { switch ((string)$value) { case 'now()': $query .= $columns . ' = now(), '; break; case 'null': $query .= $columns .= ' = null, '; break; default: $query .= $columns . ' = \'' . tep_db_input($value) . '\', '; break; } } $query = substr($query, 0, -2) . ' where ' . $parameters; } return tep_db_query($query, $link); } function tep_db_fetch_array($db_query) { return mysql_fetch_array($db_query, MYSQL_ASSOC); } function tep_db_num_rows($db_query) { return mysql_num_rows($db_query); } function tep_db_data_seek($db_query, $row_number) { return mysql_data_seek($db_query, $row_number); } function tep_db_insert_id() { return mysql_insert_id(); } function tep_db_free_result($db_query) { return mysql_free_result($db_query); } function tep_db_fetch_fields($db_query) { return mysql_fetch_field($db_query); } function tep_db_output($string) { return htmlspecialchars($string); } function tep_db_input($string) { return addslashes($string); } function tep_db_prepare_input($string) { if (is_string($string)) { return trim(tep_sanitize_string(stripslashes($string))); } elseif (is_array($string)) { reset($string); while (list($key, $value) = each($string)) { $string[$key] = tep_db_prepare_input($value); } return $string; } else { return $string; } } ?>
Guest Posted January 10, 2006 Posted January 10, 2006 Now this is confusing because the error message reads: mysql_pconnect(): But by commenting out that line you should have either got access, or the error message should now read mysql_connect(): Ok, try this - change: if (USE_PCONNECT == 'true') { // $$link = mysql_pconnect($server, $username, $password); } else { $$link = mysql_connect($server, $username, $password); } to: //if (USE_PCONNECT == 'true') { // $$link = mysql_pconnect($server, $username, $password); //} else { $$link = mysql_connect($server, $username, $password); //} lemme know - at the very least the error message should change.
Guest Posted January 10, 2006 Posted January 10, 2006 k, well aside from double checking your database settings in admin/includes/configure.php, I'm stumped. U did check that...?
Guest Posted January 10, 2006 Posted January 10, 2006 Yes, I did check. Like I said, this suddenly just happened. Weird. I also tried restarting the sql-server without any change.
Guest Posted January 18, 2006 Posted January 18, 2006 I still have the same problem..... Does anyone know what to do ?
Gwyn Posted January 19, 2006 Posted January 19, 2006 Hi, At my request, I have asked my provided to move me to a server with MySql V4.x .. Now, I am getting the same issue. (Migration was last night) I will spend some time fixing this and hopefully let you know how it was done. Maybe it will help you also. I needed the database upgarded to support SugarCRM. I am trying to integrate both OSC and SugarCRM to provide a single view of our customer's communication, Orders, requests, emails, tel cons etc. More soon I hope, Regards Gwyn
Gwyn Posted January 20, 2006 Posted January 20, 2006 Update on above: It turns out that they had not completed the build. So they still had things to do (I susspect an upgrade of PHP). Anyway, just to let you know I was having the same error and now it is fine. So your problem could be that something has changed on the server by your provider. Not much help I know, but it may be useful ? Regards, Gwyn.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.