Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Common SQL Error Codes and Solutions:

If you are receiving this "generic error":

SQL ERROR: Database error only visible to forum administrators

Warning: Supplied argument is not a valid MySQL result resource in /rd1/www/ubbthreads/mysql.inc.php on line 121


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.

1. Backup the mysql.inc.php file first.
2. Edit mysql.inc.php file with a text editor
3. Find this near the very bottom:

Code
<br />     if ( ($user['U_Status'] != "Administrator") <br />        && ( (!stristr($What,"createtable")) && (!stristr($What,"altertable")) && (!stristr($What,"ubbimport.php")) ) ) {<br />          $error = "Database error only visible to forum administrators";<br />     }<br />     else {<br />          $this->errordesc = mysql_error();<br />     }<br />

4. Change to this:
Code
<br />//     if ( ($user['U_Status'] != "Administrator") <br />//        && ( (!stristr($What,"createtable")) && (!stristr($What,"altertable")) && (!stristr($What,"ubbimport.php")) ) ) {<br />//          $error = "Database error only visible to forum administrators";<br />//     }<br />//     else {<br />           $this->errordesc = mysql_error();<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.


Common Errors:

Can't open file: 'w3t_Online.MYI'. (errno: 145)

Error Number 145 = Table was marked as crashed and should be repaired.

Generally this query will fix this:


REPAIR TABLE w3t_Online


*Substitue whatever the table name is for "w3t_Online" above to repair whatever database table is corrupted.


SQL ERROR: Unable to do_query: blah blah blah
Got error 28 from table handler


Error Number 28 = No space left on device


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.


SQL ERROR: Unable to do query: Blah blah blah Got error 127 from table handler

Error 127 = Unknown Error / Record File Crashed


You can generally look at what table or tables it was trying to Query and run the Repair Table command for that table.

For example, if the query throwing the error is the w3t_Posts table, you can try entering this SQL Query:

REPAIR TABLE w3t_Posts


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.



If you have more common errors/solutions that should be included here, feel free to post.

Sponsored Links
Entire Thread
Subject Posted By Posted
Common MySQL Errors and Solutions JoshPet 09/11/2003 9:22 AM
Re: Common MySQL Errors and Solutions Slawek_L 09/11/2003 7:13 PM
Re: Common MySQL Errors and Solutions JoshPet 09/11/2003 7:18 PM
Re: Common MySQL Errors and Solutions Dave_L_dup1 09/11/2003 7:32 PM
Re: Common MySQL Errors and Solutions Slawek_L 09/11/2003 8:24 PM
Re: Common MySQL Errors and Solutions Rick 09/12/2003 6:20 PM
Re: Common MySQL Errors and Solutions JoshPet 09/12/2003 8:30 PM
Re: Common MySQL Errors and Solutions Chevy454 12/22/2003 5:36 AM
Re: Common MySQL Errors and Solutions JoshPet 12/22/2003 6:04 AM
Re: Common MySQL Errors and Solutions Chevy454 12/22/2003 6:31 PM
Re: Common MySQL Errors and Solutions JoshPet 12/22/2003 8:14 PM
Re: Common MySQL Errors and Solutions steelhead 02/06/2004 5:37 AM
Re: Common MySQL Errors and Solutions JoshPet 02/06/2004 7:16 AM
Re: Common MySQL Errors and Solutions steelhead 02/06/2004 7:35 AM
Re: Common MySQL Errors and Solutions HooG 02/18/2004 12:19 PM
Re: Common MySQL Errors and Solutions Jelly_Donut 04/27/2004 2:48 AM

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
JAISP
JAISP
PA
Posts: 449
Joined: February 2008
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)