My SQL Sever has gone away ...

Problems with the Windows version of XAMPP, questions, comments, and anything related.

My SQL Sever has gone away ...

Postby dummydeveloper » 18. October 2012 10:47

I'm running the xampp project on various local machines using all probable versions concerning Windows and xampp versions as well (e.g. xampp 1.7.4/1.7.7/1.8.0 and Win XP/Vista/Seven) in any combination mode.
The table contains among the other type of columns one of blob type.
I' ve changed again and again all possible recommendations found on the net but with no success. I' ve already changed the upload_max_filesize to 40M, post_maxsize to 40M on php.ini file. All other suggestions on various posts prompting changes to other values had no effect in my case.

Pls any suggestion for my problem?

Sorry for not including the source code for the time being. This moment I'm sitting on a desktop which is not allowed to connect to the Internet and the production net for security reasons. If it is so vital for someone I'll upload the source code as soon I'll be back on the appropriate desktop.

Thnx in advance!

Nicholas
dummydeveloper
 
Posts: 3
Joined: 18. October 2012 10:20
XAMPP Version: 5.5.19
Operating System: Windows XP

Re: My SQL Sever has gone away ...

Postby JonB » 18. October 2012 11:14

Hello Nicholas -

Its very unclear what your problem is. The subject says "My SQL Sever has gone away ...' I've answered a question just like that in the past month. "That" meant the user apparently 'lost' the database - it was inaccessible because it was erased or the connection was not working. However - that does not appear to be your problem.

What exactly is it that MySQL won't do for you? Apparently it probably has to do with a binary object and blob datatype...

In the realm of geekdom, its all about the details.

Good Luck
8)



ycf
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
XAMPP Version: 1.8.3-2
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: My SQL Sever has gone away ...

Postby dummydeveloper » 18. October 2012 18:55

As I mentioned before I must provide the source code clarifying the issue so:
------------------------------------------------------------------------------------------
<HTML>
<BODY text="#000000" bgcolor="wheat">
<h1><p align="center"><font face="Verdana">Inserting File in DataBase</h1></font></p>
<hr>
<?php
$name = $_FILES['myfile']['name'];
$type = $_FILES['myfile']['type'];
$size = $_FILES['myfile']['size'];
$temp = $_FILES['myfile']['tmp_name'];
$fp = fopen($temp, 'r');
$data = fread($fp, filesize($temp));
$data = addslashes($data);
fclose($fp);
?>
<font face="Verdana">
<?php
echo "file name: "; echo $name; echo "<br>";
echo "file type: "; echo $type; echo "<br>";
echo "file size: "; echo $size; echo "<br>";
echo "temp location: "; echo $temp ; echo "";
?>
<br>
</font>
<hr>
<?php
if (($name and $type and $data and $size and $temp) <> NULL)
{
$curdate = date('Y/m/d H:i');
// $curdate = "Europe/Athens";
$db = mysql_connect("localhost", "root", "");
mysql_select_db("alpha", $db) or die(mysql_errno() . ": " . mysql_error() . "<br>");
$qry = "insert into myfiles (name, type, size, date, data) values
(\"$name\", \"$type\", \"$size\", \"$curdate\", \"$data\")";
mysql_query($qry) or die("Error... Query Failed!"); echo "<br>";
echo "<p align = \"center\"><font face =\"VERDANA\" color=\"GREEN\">Record Inserted</font><hr>";
echo "</p>";
echo "<br>";
//mysql_free_result($result);
mysql_close($db);
echo "<p align=\"center\">";
echo "<a href=\"select_file.php\"><img src=\"rewind.jpg\"></a>";
echo "</p>";
}
else
{
echo "<p align = \"center\"><font face =\"VERDANA\" color=\"RED\">Unable to Insert Record<hr></font></p>";
echo "<font color=\"BLUE\"<hr>$data</font><hr>";
echo "<p align=\"center\">"; echo "<br>";
echo "<a href=\"select_file.php\"><img src=\"rewind.jpg\"></a>";
echo "</p>";
}
?>
</BODY>
</HTML>
-----------------------------------------------------------------------------------------
the calling script is:
------------------------
HTML>
<BODY text="#000000" bgcolor="wheat">
<h1><p align="center"><font face="Verdana">Select</h1></font></p>
<hr>
<p align = "center">
<font face= "Verdana">
Max File Size Allowed for Upload up to 40 MB
<FORM METHOD= "post" ACTION= "insert_file.php" ENCTYPE= "multipart/form-data">
<INPUT TYPE = "hidden" NAME= "MAX_FILE_SIZE" VALUE = "20000000">
<INPUT TYPE = "hidden" NAME= "action" VALUE = "upload">
<TABLE BORDER = "6" bgcolor="pink">
<TR>
<TR>
<TD>File</TD>
<TD>
<?php
echo "<INPUT TYPE = \"file\" NAME= \"myfile\">";
?>
</TD>
</TR>
<TR>
<TD COLSPAN = "10"> <p align = "center"> <INPUT TYPE = "submit" VALUE = "Upload"> </p> </TD>
</TR>
</TABLE>
</FORM>
</font>
</p>
</BODY>
</HTML>
--------------------------
the deriving msg is: My SQL Server has gone away in line ......
dummydeveloper
 
Posts: 3
Joined: 18. October 2012 10:20
XAMPP Version: 5.5.19
Operating System: Windows XP

Re: My SQL Sever has gone away ...

Postby JonB » 18. October 2012 19:55

You should look in the MySQL error log.

the deriving msg is: My SQL Server has gone away in line ......

WHAT LINE? WHAT LINE?

:?:
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
XAMPP Version: 1.8.3-2
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: My SQL Sever has gone away ...

Postby dummydeveloper » 22. October 2012 17:24

Problem Solved:
You have to change in c:\xamll\mysql\bin directory
the file named my.ini
the existing value of
# max_allowed_packet = 1M
to the desired value e.g.
max_allowed_packet = 40M
Thank you for your interest in my problem
Nicholas
dummydeveloper
 
Posts: 3
Joined: 18. October 2012 10:20
XAMPP Version: 5.5.19
Operating System: Windows XP


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 35 guests