View Single Post
  #40  
Old 04-14-2007, 02:50 PM
 
cautious cautious is offline
 

Advanced Member
  
Join Date: Oct 2003
Location: FL, US
Posts: 64
 

Default Re: Database Auto-Optimizer

Yes, today I started getting sql_query failure too, as shown by the snap shot below. My email is also full or related notifications

=======================
INVALID SQL: 0 :
SQL QUERY FAILURE: SELECT count(*) FROM xcart_sessions_data WHERE sessid='681572c3424d8ed7f5dbb16c57dda74c'
SQL QUERY FAILURE: UPDATE xcart_sessions_data SET data='a:13:{s:5:\"login\";s:0:\"\";s:11:\"editor_m ode\";s:0:\"\";s:8:\"sns_flag\";s:0:\"\";s:13:\"sn s_do_action\";s:0:\"\";s:8:\"is_robot\";s:1:\"N\"; s:5:\"robot\";s:0:\"\";s:11:\"is_location\";s:0:\" \";s:9:\"adaptives\";a:1:{s:14:\"is_first_start\"; s:1:\"Y\";}s:10:\"login_type\";s:0:\"\";s:6:\"logg ed\";s:0:\"\";s:11:\"top_message\";s:0:\"\";s:16:\ "current_language\";s:2:\"US\";s:17:\"merchant_pas sword\";s:0:\"\";}' WHERE sessid='681572c3424d8ed7f5dbb16c57dda74c'
INVALID SQL: 0 :
SQL QUERY FAILURE: UPDATE xcart_sessions_data SET data='a:13:{s:5:\"login\";s:0:\"\";s:11:\"editor_m ode\";s:0:\"\";s:8:\"sns_flag\";s:0:\"\";s:13:\"sn s_do_action\";s:0:\"\";s:8:\"is_robot\";s:1:\"N\"; s:5:\"robot\";s:0:\"\";s:11:\"is_location\";s:0:\" \";s:9:\"adaptives\";a:1:{s:14:\"is_first_start\"; s:1:\"Y\";}s:10:\"login_type\";s:0:\"\";s:6:\"logg ed\";s:0:\"\";s:11:\"top_message\";s:0:\"\";s:16:\ "current_language\";s:2:\"US\";s:17:\"merchant_pas sword\";s:0:\"\";}' WHERE sessid='681572c3424d8ed7f5dbb16c57dda74c'
=======================

As a result my site was useless. I researched this on the internet. It appears that many x-cart sites have experienced similar problems at one time or the other. Yes, I agree with balinor and others elsewhere in this forum that it is not x-cart direct problem. Nonetheless, I think x-cart should still research this and supply an integrated solution as part of HA and store maintenance feature.

Here is the solution that eventually worked for me to remedy the problem. It may work for you too. Note that I have a dedicated server so I was able to login and perform these steps manually. I recommend manual operation.

1. First backup you DB. Multiple ways to do this. In my case, I simply stopped mysqld (/etc/init.d/mysqld stop) and then made a zipped tarball of the DB (tar cvzf mysql_bak.tgz mysql ). Then start the DB (/etc/init.d/mysqld start)

2. Review the error(s) with this
mysqlcheck -s -u [Your_db_root_uname] -p[Hispasswd] [TheDBname]

where [text] is what you must supply as your correct value w/o the delimiting square brackets.

3. Then do the repair with this
mysqlcheck -r -q -u [Your_db_root_uname] -p[Hispasswd] [TheDBname]

4. Hopefully the above fixes all the problem as evident by the OK's it spits out. Just to be sure, repeat Step 2 to verify all the errors are gone:
mysqlcheck -s -u [Your_db_root_uname] -p[Hispasswd] [TheDBname]

If all is well, the last command should just return a prompt. If not, if you still have errors, you may need a professional to step in.

Cheers
__________________
Recommend www.paintball-gear-supplies.com for good deals on camping & outdoor supplies.
x-cart v4.1.10 on LAMP
Reply With Quote