php forum
php mysql forum
php mysql smarty
 
Topic Options
#258490 - 09/11/03 02:22 AM Common MySQL Errors and Solutions
JoshPet Offline
I type Like navaho

Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC

   Common MySQL Errors and Solutions to Del.icio.us Add to del.icio.us
  Digg Common MySQL Errors and Solutions Digg it
Common SQL Error Codes and Solutions:<br /><br />If you are receiving this "generic error":<br /><br />SQL ERROR: Database error only visible to forum administrators<br /><br />Warning: Supplied argument is not a valid MySQL result resource in /rd1/www/ubbthreads/mysql.inc.php on line 121<br /><br />or similar, the real error message is being masked. You must first either check your MySQL error logs for the actual error, or edit the mysql.inc.php file to allow it to be displayed, so that you can track down what's wrong.<br /><br />1. Backup the mysql.inc.php file first.<br />2. Edit mysql.inc.php file with a text editor<br />3. Find this near the very bottom:<br /><br />
Code:
<br />     if ( ($user['U_Status'] != "Administrator") <br />        &amp;&amp; ( (!stristr($What,"createtable")) &amp;&amp; (!stristr($What,"altertable")) &amp;&amp; (!stristr($What,"ubbimport.php")) ) ) {<br />          $error = "Database error only visible to forum administrators";<br />     }<br />     else {<br />          $this-&gt;errordesc = mysql_error();<br />     }<br />
<br />4. Change to this:<br />
Code:
<br />//     if ( ($user['U_Status'] != "Administrator") <br />//        &amp;&amp; ( (!stristr($What,"createtable")) &amp;&amp; (!stristr($What,"altertable")) &amp;&amp; (!stristr($What,"ubbimport.php")) ) ) {<br />//          $error = "Database error only visible to forum administrators";<br />//     }<br />//     else {<br />           $this-&gt;errordesc = mysql_error();<br />//     }<br />
<br /><br />Now the screen will display the actual error, which you can report. Once the problem is resolved, return the mysql.inc.php file to the original state so that errors are not readily displayed to everyone. <img src="/forum/images/graemlins/wink.gif" alt="" /><br /><br /><br />Common Errors:<br /><br /> Can't open file: 'w3t_Online.MYI'. (errno: 145) <br /><br />Error Number 145 = Table was marked as crashed and should be repaired.<br /><br />Generally this query will fix this:<br /><br /><br />REPAIR TABLE w3t_Online<br /><br /><br />*Substitue whatever the table name is for "w3t_Online" above to repair whatever database table is corrupted. <br /><br /><br />SQL ERROR: Unable to do_query: blah blah blah<br />Got error 28 from table handler<br /><br />Error Number 28 = No space left on device<br /><br /><br />Verify that your webserver or the partition where the database is stored on your server is not out of space. Once this is corrected, you may need to run the REPAIR TABLE command listed above, as corruption sometimes occurs when MySQL attempts to write data to a full drive. <br /><br /><br />SQL ERROR: Unable to do query: Blah blah blah Got error 127 from table handler<br /><br />Error 127 = Unknown Error / Record File Crashed<br /><br /><br />You can generally look at what table or tables it was trying to Query and run the Repair Table command for that table.<br /><br />For example, if the query throwing the error is the w3t_Posts table, you can try entering this SQL Query:<br /><br />REPAIR TABLE w3t_Posts<br /><br /><br />If this does not work, you may need to ask your webhost to run myisamchk on your database. You can also try dumping and restoring the database with the mysqldump command.<br /><br /><br /><br />If you have more common errors/solutions that should be included here, feel free to post. <img src="/forum/images/graemlins/smile.gif" alt="" />
_________________________
Joshua Pettit
www.JoshuaPettit.com
My abilities are for hire.

Top
#258491 - 09/11/03 12:13 PM Re: Common MySQL Errors and Solutions [Re: Daine]
Slawek_L Offline
Enthusiast

Registered: 01/28/03
Posts: 364
Loc: Poland, Warsaw
Code:
<br />     if ( ($user['U_Status'] != "Administrator") <br />        &amp;&amp; ( (!stristr($What,"createtable")) &amp;&amp; (!stristr($What,"altertable")) &amp;&amp; (!stristr($What,"ubbimport.php")) ) ) {<br />          $error = "Database error only visible to forum administrators";<br />     }<br />     else {<br />          $this-&gt;errordesc = mysql_error();<br />     }<br />
<br />4. Change to this:<br />
Code:
<br />//     if ( ($user['U_Status'] != "Administrator") <br />//        &amp;&amp; ( (!stristr($What,"createtable")) &amp;&amp; (!stristr($What,"altertable")) &amp;&amp; (!stristr($What,"ubbimport.php")) ) ) {<br />//          $error = "Database error only visible to forum administrators";<br />//     }<br />//     else {<br />           $this-&gt;errordesc = mysql_error();<br />//     }<br />
<br /><br />I dont see any differnce in this code <img src="/forum/images/graemlins/confused.gif" alt="" />
_________________________
[]http://www.mb.org.pl/forum/images/graemlins/icon_astro.gif[/] MB Klub Polska
[b]& Orlen-Team

Top
#258492 - 09/11/03 12:18 PM Re: Common MySQL Errors and Solutions [Re: Dawg_dup1]
JoshPet Offline
I type Like navaho

Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC
Most of it's commented out (note the // ) so that it will display the errors.
_________________________
Joshua Pettit
www.JoshuaPettit.com
My abilities are for hire.

Top
#258493 - 09/11/03 12:32 PM Re: Common MySQL Errors and Solutions [Re: Daine]
Dave_L_dup1 Offline
Addict

Registered: 04/23/02
Posts: 1929
Loc: Virginia, USA
Here's an easier way of making that temporary change:<br /><br />
Code:
if ([:"red"]FALSE &amp;&amp; [/]($user['U_Status'] != "Administrator") <br />   &amp;&amp; ( (!stristr($What,"createtable")) &amp;&amp; (!stristr($What,"altertable")) &amp;&amp; (!stristr($What,"ubbimport.php")) ) ) {<br />      $error = "Database error only visible to forum administrators";<br />}<br />else {<br />   $this-&gt;errordesc = mysql_error();<br />}
_________________________
UBB.threads beta tester / threadsdev.com moderator
Software consulting services including UBB.threads problem resolution / installs / upgrades / customization.

Top
#258494 - 09/11/03 01:24 PM Re: Common MySQL Errors and Solutions [Re: Daine]
Slawek_L Offline
Enthusiast

Registered: 01/28/03
Posts: 364
Loc: Poland, Warsaw
[]JoshPet said:<br />Most of it's commented out (note the // ) so that it will display the errors. [/]<br /><br /><br /> <img src="/forum/images/graemlins/blush.gif" alt="" /> ups <img src="/forum/images/graemlins/blush.gif" alt="" />
_________________________
[]http://www.mb.org.pl/forum/images/graemlins/icon_astro.gif[/] MB Klub Polska
[b]& Orlen-Team

Top
#258495 - 09/12/03 11:20 AM Re: Common MySQL Errors and Solutions [Re: joeuser]
Rick Offline
Guru

Registered: 05/11/99
Posts: 8372
Loc: Olympia, WA
If you are running version 6.3 or later you can also edit this one line in the not_right function:<br /><br /> $showerror = 0;<br /><br />If you change that to 1 it will show the mysql errors to all.
_________________________
StogieSmokers.com

Top
#258496 - 09/12/03 01:30 PM Re: Common MySQL Errors and Solutions [Re: Sally]
JoshPet Offline
I type Like navaho

Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC
Oh Awesome..... Good to know. <img src="/forum/images/graemlins/wink.gif" alt="" />
_________________________
Joshua Pettit
www.JoshuaPettit.com
My abilities are for hire.

Top
#258497 - 12/21/03 09:36 PM Re: Common MySQL Errors and Solutions [Re: Daine]
Chevy454 Offline
Member

Registered: 03/25/00
Posts: 227
Loc: Alton, MO, USA
Beginner question for you guys, but I'm trying to learn...<br /><br />After I run a repair table, I get the below message, but would like to know what it means:<br /><br />"Resource id #12 row(s) affected by your query."

Top
#258498 - 12/21/03 10:04 PM Re: Common MySQL Errors and Solutions [Re: CPBpnM]
JoshPet Offline
I type Like navaho

Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC
That's just a confirmation telling you that the repair worked. <br /><br />I think it means 12 rows needed to be repaired (or the 12th row). Something like that.
_________________________
Joshua Pettit
www.JoshuaPettit.com
My abilities are for hire.

Top
#258499 - 12/22/03 10:31 AM Re: Common MySQL Errors and Solutions [Re: Daine]
Chevy454 Offline
Member

Registered: 03/25/00
Posts: 227
Loc: Alton, MO, USA
Thanks! I was just curious, because I've just now noticed on the last couple of times I've had to repair that it's given me that "resource id #12" mumbo jumbo, and I wasn't for sure if I had an error somewhere that kept repeating. It does keep throwing up the the "error 127" fairly often as of late, whiping out the front page of our forum...isn't that eroor # normally something on the ISP's end?

Top
#258500 - 12/22/03 12:14 PM Re: Common MySQL Errors and Solutions [Re: CPBpnM]
JoshPet Offline
I type Like navaho

Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC
Yes, I would attribute that to a badly tuned mysql configuration or server.
_________________________
Joshua Pettit
www.JoshuaPettit.com
My abilities are for hire.

Top
#258501 - 02/05/04 09:37 PM Re: Common MySQL Errors and Solutions [Re: Daine]
steelhead Offline
Power User

Registered: 01/14/04
Posts: 99
Loc: Portland, Oregon
I am not seeing any of this code in 6.4.1. I am getting major error messages. And my board is down. What is the code on 6.4.1
_________________________
Fish-On
Qualityfishing.net

Top
#258502 - 02/05/04 11:16 PM Re: Common MySQL Errors and Solutions [Re: Daine]
JoshPet Offline
I type Like navaho

Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC
In 6.4.1 he made it even easier. <img src="http://www.ubbdev.com/forum/images/graemlins/smile.gif" alt="" /><br /><br />Find this:<br />
Code:
<br />      // IF YOU SET THE VARIABLE BELOW TO 1 IT WILL SHOW THE SQL ERRORS TO ALL<br />      // USERS.  USEFUL IF YOU CANNOT LOG IN AND NEED TO SEE THE SQL ERRORS<br />      $showerror = 0;<br />
<br /><br />Change to this:<br />
Code:
<br />      // IF YOU SET THE VARIABLE BELOW TO 1 IT WILL SHOW THE SQL ERRORS TO ALL<br />      // USERS.  USEFUL IF YOU CANNOT LOG IN AND NEED TO SEE THE SQL ERRORS<br />      $showerror = 1;<br />
_________________________
Joshua Pettit
www.JoshuaPettit.com
My abilities are for hire.

Top
#258503 - 02/05/04 11:35 PM Re: Common MySQL Errors and Solutions [Re: Daine]
steelhead Offline
Power User

Registered: 01/14/04
Posts: 99
Loc: Portland, Oregon
Good info to have. thanks
_________________________
Fish-On
Qualityfishing.net

Top
#258504 - 02/18/04 04:19 AM Re: Common MySQL Errors and Solutions [Re: Starfleet14]
HooG Offline
Lurker

Registered: 02/05/04
Posts: 6
Loc: Poland, Lubin
Does anyone know what Error 134 mean, or maybe You know where I can get the complete list of errors. Already tried at mysql home page, but its hard to find something there <img src="http://www.ubbdev.com/forum/images/graemlins/wink.gif" alt="" />
_________________________
I love hard work ... I could watch it for hours <img src="http://www.ubbdev.com/forum/images/graemlins/laugh.gif" alt="" />

Top
#258505 - 04/26/04 07:48 PM Re: Common MySQL Errors and Solutions [Re: Nick H]
Jelly_Donut Offline
User

Registered: 04/11/03
Posts: 32
Loc: USA
Error 134 means that the table record has crashed, or a record you are trying to access has been deleted.<br /><br />To find out the meaning of any MySQL error, first you need to download MySQL on your computer. Then lauch a command prompt (cmd.exe on WinXP). Then type
Code:
C:\mysql\bin\perror.exe -errorno
(Obviously for Windows only, similar on *Nix). You can use a comma-separated list of error numbers if you wish <img src="http://www.ubbdev.com/forum/images/graemlins/smile.gif" alt="" /><br /><br />(Sorry for bumping this, even though it is sticky...)
_________________________
I am out of place here. I use phpBB over Threads.
Debate this signature with me
I help develop CMSformE

Top


Who's Online
0 Registered (), 39 Guests and 6 Spiders online.
Key: Admin, Global Mod, Mod
Shout Box

Latest Posts
Blogs, love em or hate em?
by Ian_W
Yesterday at 03:47 PM
What do you use to edit the files
by Ian_W
Yesterday at 03:33 PM
BeyondCompare v3.00
by Ian_W
Yesterday at 03:32 PM
Glossy Black Theme with Image Reflection
by Gizmo
Yesterday at 02:17 PM
ShareThis
by Gizmo
09/28/08 05:06 AM
[7.3] Viewing MySQL logfiles made easier
by AllenAyres
09/27/08 09:57 PM
Looking for a simple upload script
by Murphdog
09/26/08 08:45 PM
New Mods
[7.3] Viewing MySQL logfiles made easier
by blaaskaak
09/24/08 05:39 PM
[7.3] Language file checker
by blaaskaak
09/09/08 12:56 AM
[7.3.1] add search to showmembers page
by blaaskaak
09/07/08 04:50 AM
Multiple Identity Detector
by
12/30/06 06:39 PM
Newest Members
ghengis317, NitroX, Dogan, EliYah-, W-D
13344 Registered Users
Top Posters Last 30 Days
AllenAyres 16
blaaskaak 13
FREAK1 7
Mike L_dup1 4
Chris Bale 4
Ian_W 4
tackaberry 3

 

 

 
fusionbb message board php hacks