Unlock Seamless Magento Functionality with Experts!
  • 20+ years of experience
  • Top 1% software engineering talent
  • 675+ digital transformation experts

SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction. This issue is called the Deadlock issue. Sometimes it is caused by the database.

The reason behind this issue is that you are running a lot of custom scripts and killing the scripts before the database connection gets a chance to close.

If you can login to MySQL from CLI and run the following command

SHOW PROCESSLIST;

you will see the following output

Id User Host DB Command Time State Info Rows_sent Rows_examined Rows_read
162db_user111.11.0.65:21532db_nameSleep3850NULL000
175db_user111.11.0.65:27488db_nameSleep3757NULL000
176db_user111.11.0.65:32670db_nameSleep3731NULL000
190db_user111.11.0.65:47424db_nameSleep3639NULL000
210db_user111.11.0.65:56029db_nameSleep3591NULL000
211db_user111.11.0.65:59201db_nameSleep3567NULL000
225db_user111.11.0.65:2390db_nameSleep3529NULL000
227db_user111.11.0.65:10125db_nameSleep3473NULL000
230db_user111.11.0.65:18407db_nameSleep3424NULL000
280db_user111.11.0.65:35679db_nameSleep3330NULL000
287db_user111.11.0.65:57815db_nameSleep1860NULL000
291db_user111.11.0.67:20650db_nameSleep188NULL100
325db_user111.11.0.65:36618db_nameQuery0NULLSHOW PROCESSLIST000
330db_user111.11.0.75:38717db_nameSleep0NULL000
426db_user111.11.0.75:38819db_nameSleep0NULL616161

15 rows in set (0.00 sec)

You can see an above example 162 the command is sleep and time is 3850. This is preventing other operations. These sleep command processes should be killed 1 by 1 using the command as follows.

KILL 162; Once you have killed all the sleep connections, things should start working as normal again. If you have any query in SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction Magento, leave it in the comment segment, I will respond as soon as possible

admin

Tech Expert in Software Development.

Tech expert in software development with a focus on delivering innovative, high-performance solutions. Skilled in creating scalable applications that enhance user experience and drive business growth. Passionate about transforming ideas into impactful digital products.

AWS vs Azure vs Google Cloud: Which Platform Is Best?